Commit 7aa679e4 authored by Rachel Wong's avatar Rachel Wong Committed by Chromium LUCI CQ

Remove obsolete launcher metrics.

This CL removes a few launcher metrics that are no longer used,
including some that are expiring.

Bug: 1142490, 1152023
Change-Id: Id10ad35ee9ee6e6ed3933d811bd4bf721bdc258c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567236Reviewed-by: default avatarTony Yeoman <tby@chromium.org>
Commit-Queue: Rachel Wong <wrong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833046}
parent 54c374db
...@@ -194,7 +194,6 @@ void SearchController::OnSearchResultsDisplayed( ...@@ -194,7 +194,6 @@ void SearchController::OnSearchResultsDisplayed(
result_types.push_back( result_types.push_back(
RankingItemTypeFromSearchResult(*FindSearchResult(result.id))); RankingItemTypeFromSearchResult(*FindSearchResult(result.id)));
} }
LogZeroStateResultsListMetrics(result_types, launched_index);
} }
} }
......
...@@ -74,59 +74,12 @@ void LogZeroStateLaunchType(RankingItemType ranking_item_type) { ...@@ -74,59 +74,12 @@ void LogZeroStateLaunchType(RankingItemType ranking_item_type) {
zero_state_type); zero_state_type);
} }
void LogZeroStateReceivedScore(const std::string& suffix,
float score,
float lo,
float hi) {
if (suffix.empty())
return;
DCHECK(lo < hi);
// Record the scaled score's floor in order to preserve its bucket.
base::UmaHistogramExactLinear(
"Apps.AppList.ZeroStateResults.ReceivedScore." + suffix,
floor(100 * (score - lo) / (hi - lo)), 100);
}
void LogZeroStateResultsListMetrics(
const std::vector<RankingItemType>& result_types,
int launched_index) {
// Log position of clicked items.
if (launched_index >= 0) {
UMA_HISTOGRAM_EXACT_LINEAR(
"Apps.AppList.ZeroStateResultsList.LaunchedItemPositionV2",
launched_index, 5);
}
// Log the number of types shown in the impression set.
base::flat_set<RankingItemType> type_set(result_types);
UMA_HISTOGRAM_EXACT_LINEAR(
"Apps.AppList.ZeroStateResultsList.NumImpressionTypesV2", type_set.size(),
5);
// Log whether any Drive files were impressed.
UMA_HISTOGRAM_BOOLEAN("Apps.AppList.ZeroStateResultsList.ContainsDriveFiles",
type_set.contains(RankingItemType::kDriveQuickAccess));
// Log CTR metrics. Note that all clicks are captured and indicated by a
// non-negative launch index, while an index of -1 indicates that results were
// impressed on screen for some amount of time.
UMA_HISTOGRAM_BOOLEAN("Apps.AppList.ZeroStateResultsList.Clicked",
launched_index >= 0);
}
void LogChipUsageMetrics(const AppLaunchData& launch) { void LogChipUsageMetrics(const AppLaunchData& launch) {
// Filter launches that aren't from the chips. // Filter launches that aren't from the chips.
if (launch.launched_from != if (launch.launched_from !=
ash::AppListLaunchedFrom::kLaunchedFromSuggestionChip) ash::AppListLaunchedFrom::kLaunchedFromSuggestionChip)
return; return;
// Total usage.
UMA_HISTOGRAM_BOOLEAN("Apps.AppList.SuggestedFiles.ChipLaunched", true);
// Usage per chip type.
UMA_HISTOGRAM_ENUMERATION("Apps.AppList.SuggestedFiles.LaunchType",
launch.ranking_item_type);
// Launch index. At most 5 chips are shown and indices are 0-based, so the // Launch index. At most 5 chips are shown and indices are 0-based, so the
// maximum index is 4. // maximum index is 4.
UMA_HISTOGRAM_EXACT_LINEAR("Apps.AppList.SuggestedFiles.LaunchIndex", UMA_HISTOGRAM_EXACT_LINEAR("Apps.AppList.SuggestedFiles.LaunchIndex",
......
...@@ -96,29 +96,6 @@ void LogJsonConfigConversionStatus(const std::string& suffix, ...@@ -96,29 +96,6 @@ void LogJsonConfigConversionStatus(const std::string& suffix,
void LogZeroStateLaunchType(RankingItemType type); void LogZeroStateLaunchType(RankingItemType type);
// Log |score| within the [lo, hi] range divided into 100 buckets. |lo| is
// reported as 0 and |hi| as 100. Values below |lo| are reported in the bottom
// bucket, similarly for |hi|.
void LogZeroStateReceivedScore(const std::string& suffix,
float score,
float lo,
float hi);
// Logs zero state UI-related metrics. These comprise of the clicked position,
// number of types per impression set, and CTR metrics.
void LogZeroStateResultsListMetrics(
const std::vector<RankingItemType>& result_types,
int launched_index);
// Logs three metrics of interest related to the suggested chips.
//
// 1. How many chips are launched overall.
// 2. How many of each chip type is launched: local file, drive file, app.
// 3. The index of a launched chip.
//
// We are interested in absolute numbers for these values, not CTR, because
// we expect experiments with the chips to change the base rate usage of the
// launcher chips itself.
void LogChipUsageMetrics(const AppLaunchData& app_launch_data); void LogChipUsageMetrics(const AppLaunchData& app_launch_data);
} // namespace app_list } // namespace app_list
......
// Copyright (c) 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/app_list/search/search_result_ranker/histogram_util.h"
#include <tuple>
#include <vector>
#include "base/containers/flat_set.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/ui/app_list/search/search_result_ranker/ranking_item_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace app_list {
class HistogramUtilTest : public testing::Test {
public:
HistogramUtilTest() {}
~HistogramUtilTest() override {}
const base::HistogramTester histogram_tester_;
private:
DISALLOW_COPY_AND_ASSIGN(HistogramUtilTest);
};
TEST_F(HistogramUtilTest, TestLaunchedItemPosition) {
std::vector<RankingItemType> result_types = {
RankingItemType::kOmniboxGeneric, RankingItemType::kZeroStateFile,
RankingItemType::kZeroStateFile, RankingItemType::kZeroStateFile};
// Don't log if there is no click.
LogZeroStateResultsListMetrics(result_types, -1);
histogram_tester_.ExpectTotalCount(
"Apps.AppList.ZeroStateResultsList.LaunchedItemPositionV2", 0);
// Log some actual clicks.
LogZeroStateResultsListMetrics(result_types, 3);
histogram_tester_.ExpectBucketCount(
"Apps.AppList.ZeroStateResultsList.LaunchedItemPositionV2", 3, 1);
LogZeroStateResultsListMetrics(result_types, 2);
histogram_tester_.ExpectBucketCount(
"Apps.AppList.ZeroStateResultsList.LaunchedItemPositionV2", 2, 1);
}
TEST_F(HistogramUtilTest, TestNumImpressionTypes) {
// No results.
std::vector<RankingItemType> result_types_1;
LogZeroStateResultsListMetrics(result_types_1, 0);
histogram_tester_.ExpectBucketCount(
"Apps.AppList.ZeroStateResultsList.NumImpressionTypesV2", 0, 1);
// Several types of results.
std::vector<RankingItemType> result_types_2 = {
RankingItemType::kOmniboxGeneric, RankingItemType::kZeroStateFile,
RankingItemType::kDriveQuickAccess};
LogZeroStateResultsListMetrics(result_types_2, 0);
histogram_tester_.ExpectBucketCount(
"Apps.AppList.ZeroStateResultsList.NumImpressionTypesV2", 3, 1);
// Some types doubled up.
std::vector<RankingItemType> result_types_3 = {
RankingItemType::kOmniboxGeneric, RankingItemType::kZeroStateFile,
RankingItemType::kZeroStateFile, RankingItemType::kZeroStateFile};
LogZeroStateResultsListMetrics(result_types_3, 0);
histogram_tester_.ExpectBucketCount(
"Apps.AppList.ZeroStateResultsList.NumImpressionTypesV2", 2, 1);
}
TEST_F(HistogramUtilTest, TestContainsDriveFiles) {
// No Drive files
LogZeroStateResultsListMetrics(
{RankingItemType::kOmniboxGeneric, RankingItemType::kZeroStateFile}, 0);
histogram_tester_.ExpectUniqueSample(
"Apps.AppList.ZeroStateResultsList.ContainsDriveFiles", 0, 1);
// One Drive file
LogZeroStateResultsListMetrics(
{RankingItemType::kOmniboxGeneric, RankingItemType::kDriveQuickAccess,
RankingItemType::kZeroStateFile},
0);
histogram_tester_.ExpectBucketCount(
"Apps.AppList.ZeroStateResultsList.ContainsDriveFiles", 1, 1);
// Many Drive files
LogZeroStateResultsListMetrics(
{RankingItemType::kDriveQuickAccess, RankingItemType::kDriveQuickAccess,
RankingItemType::kDriveQuickAccess},
0);
histogram_tester_.ExpectBucketCount(
"Apps.AppList.ZeroStateResultsList.ContainsDriveFiles", 1, 2);
}
class HistogramUtilScoreTest
: public HistogramUtilTest,
public testing::WithParamInterface<std::tuple<float, float, float, int>> {
void SetUp() override {}
};
TEST_P(HistogramUtilScoreTest, ScoreTest) {
LogZeroStateReceivedScore("Test", std::get<0>(GetParam()),
std::get<1>(GetParam()), std::get<2>(GetParam()));
histogram_tester_.ExpectUniqueSample(
"Apps.AppList.ZeroStateResults.ReceivedScore.Test",
std::get<3>(GetParam()), 1);
}
constexpr std::tuple<float, float, float, int> kTestValues[] = {
{0.0f, 0.0f, 1.0f, 0}, {0.5f, 0.0f, 1.0f, 50},
{1.0f, 0.0f, 1.0f, 100}, {-10.0f, -10.0f, 10.0f, 0},
{-5.0f, -10.0f, 10.0f, 25}, {0.0f, -10.0f, 10.0f, 50},
{5.0f, -10.0f, 10.0f, 75}, {10.0f, -10.0f, 10.0f, 100},
{-100.0f, -10.0f, 10.0f, 0}, {150000.0f, -10.0f, 10.0f, 100},
};
INSTANTIATE_TEST_SUITE_P(HistogramUtilScoreTest,
HistogramUtilScoreTest,
testing::ValuesIn(kTestValues));
} // namespace app_list
...@@ -44,10 +44,6 @@ using file_manager::file_tasks::FileTasksObserver; ...@@ -44,10 +44,6 @@ using file_manager::file_tasks::FileTasksObserver;
// Limits how frequently models are queried for ranking results. // Limits how frequently models are queried for ranking results.
constexpr TimeDelta kMinSecondsBetweenFetches = TimeDelta::FromSeconds(1); constexpr TimeDelta kMinSecondsBetweenFetches = TimeDelta::FromSeconds(1);
// Limits how frequently results are logged, due to the possibility of multiple
// ranking events occurring for each user action.
constexpr TimeDelta kMinTimeBetweenLogs = TimeDelta::FromSeconds(2);
constexpr char kLogFileOpenType[] = "RecurrenceRanker.LogFileOpenType"; constexpr char kLogFileOpenType[] = "RecurrenceRanker.LogFileOpenType";
// Keep in sync with value in search_controller_factory.cc. // Keep in sync with value in search_controller_factory.cc.
...@@ -267,7 +263,6 @@ void SearchResultRanker::Rank(Mixer::SortedResults* results) { ...@@ -267,7 +263,6 @@ void SearchResultRanker::Rank(Mixer::SortedResults* results) {
if (model == Model::MIXED_TYPES) { if (model == Model::MIXED_TYPES) {
if (last_query_.empty() && zero_state_group_ranker_) { if (last_query_.empty() && zero_state_group_ranker_) {
LogZeroStateResultScore(type, result.score);
ScoreZeroStateItem(&result, type, &zero_state_type_counts); ScoreZeroStateItem(&result, type, &zero_state_type_counts);
} }
} else if (model == Model::APPS) { } else if (model == Model::APPS) {
...@@ -436,25 +431,4 @@ void SearchResultRanker::OnFilesOpened( ...@@ -436,25 +431,4 @@ void SearchResultRanker::OnFilesOpened(
} }
} }
void SearchResultRanker::LogZeroStateResultScore(RankingItemType type,
float score) {
const auto& now = Time::Now();
if (type == RankingItemType::kOmniboxGeneric) {
if (now - time_of_last_omnibox_log_ < kMinTimeBetweenLogs)
return;
time_of_last_omnibox_log_ = now;
LogZeroStateReceivedScore("OmniboxSearch", score, 0.0f, 1.0f);
} else if (type == RankingItemType::kZeroStateFile) {
if (now - time_of_last_local_file_log_ < kMinTimeBetweenLogs)
return;
time_of_last_local_file_log_ = now;
LogZeroStateReceivedScore("ZeroStateFile", score, 0.0f, 1.0f);
} else if (type == RankingItemType::kDriveQuickAccess) {
if (now - time_of_last_drive_log_ < kMinTimeBetweenLogs)
return;
time_of_last_drive_log_ = now;
LogZeroStateReceivedScore("DriveQuickAccess", score, -10.0f, 10.0f);
}
}
} // namespace app_list } // namespace app_list
...@@ -672,36 +672,4 @@ TEST_F(SearchResultRankerTest, ZeroStateClickedTypeMetrics) { ...@@ -672,36 +672,4 @@ TEST_F(SearchResultRankerTest, ZeroStateClickedTypeMetrics) {
ZeroStateResultType::kDriveQuickAccess, 1); ZeroStateResultType::kDriveQuickAccess, 1);
} }
// Scores received from zero state providers should be logged.
TEST_F(SearchResultRankerTest, ZeroStateReceivedScoreMetrics) {
EnableOneFeature(app_list_features::kEnableZeroStateMixedTypesRanker,
{
{"item_coeff", "1.0"},
{"group_coeff", "1.0"},
{"paired_coeff", "0.0"},
{"default_group_score", "0.1"},
});
auto ranker = MakeRanker();
ranker->InitializeRankers(MakeSearchController());
Wait();
ranker->FetchRankings(base::string16());
auto results =
MakeSearchResults({"A", "B", "C"},
{ResultType::kOmnibox, ResultType::kZeroStateFile,
ResultType::kDriveQuickAccess},
{0.15f, 0.255f, 0.359f});
ranker->Rank(&results);
// Scores should scaled to the range 0-100 and logged into the correct bucket.
// Zero state file and omnibox scores map the range [0,1] to [0,100], and
// Drive scores map the range [-10,10] to [0,100].
histogram_tester_.ExpectUniqueSample(
"Apps.AppList.ZeroStateResults.ReceivedScore.OmniboxSearch", 15, 1);
histogram_tester_.ExpectUniqueSample(
"Apps.AppList.ZeroStateResults.ReceivedScore.ZeroStateFile", 25, 1);
histogram_tester_.ExpectUniqueSample(
"Apps.AppList.ZeroStateResults.ReceivedScore.DriveQuickAccess", 51, 1);
}
} // namespace app_list } // namespace app_list
...@@ -4995,7 +4995,6 @@ test("unit_tests") { ...@@ -4995,7 +4995,6 @@ test("unit_tests") {
"../browser/ui/app_list/search/search_result_ranker/app_search_result_ranker_unittest.cc", "../browser/ui/app_list/search/search_result_ranker/app_search_result_ranker_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/chip_ranker_unittest.cc", "../browser/ui/app_list/search/search_result_ranker/chip_ranker_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/frecency_store_unittest.cc", "../browser/ui/app_list/search/search_result_ranker/frecency_store_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/histogram_util_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/ml_app_rank_provider_unittest.cc", "../browser/ui/app_list/search/search_result_ranker/ml_app_rank_provider_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/ranking_item_util_unittest.cc", "../browser/ui/app_list/search/search_result_ranker/ranking_item_util_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/recurrence_predictor_unittest.cc", "../browser/ui/app_list/search/search_result_ranker/recurrence_predictor_unittest.cc",
......
...@@ -411,6 +411,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -411,6 +411,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.SuggestedFiles.ChipLaunched" enum="Boolean" <histogram name="Apps.AppList.SuggestedFiles.ChipLaunched" enum="Boolean"
expires_after="2021-05-16"> expires_after="2021-05-16">
<obsolete>
Removed December 2020.
</obsolete>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
<summary> <summary>
...@@ -432,6 +435,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -432,6 +435,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.SuggestedFiles.LaunchType" <histogram name="Apps.AppList.SuggestedFiles.LaunchType"
enum="LauncherRankingItemType" expires_after="2021-05-30"> enum="LauncherRankingItemType" expires_after="2021-05-30">
<obsolete>
Removed December 2020.
</obsolete>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
<summary> <summary>
...@@ -554,6 +560,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -554,6 +560,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateResults.ReceivedScore.DriveQuickAccess" <histogram name="Apps.AppList.ZeroStateResults.ReceivedScore.DriveQuickAccess"
units="score" expires_after="2021-04-18"> units="score" expires_after="2021-04-18">
<obsolete>
Removed December 2020.
</obsolete>
<owner>wrong@chromium.org</owner> <owner>wrong@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
...@@ -566,6 +575,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -566,6 +575,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateResults.ReceivedScore.OmniboxSearch" <histogram name="Apps.AppList.ZeroStateResults.ReceivedScore.OmniboxSearch"
units="score" expires_after="2021-04-11"> units="score" expires_after="2021-04-11">
<obsolete>
Removed December 2020.
</obsolete>
<owner>wrong@chromium.org</owner> <owner>wrong@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
...@@ -578,6 +590,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -578,6 +590,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateResults.ReceivedScore.ZeroStateFile" <histogram name="Apps.AppList.ZeroStateResults.ReceivedScore.ZeroStateFile"
units="score" expires_after="2020-12-06"> units="score" expires_after="2020-12-06">
<obsolete>
Removed December 2020.
</obsolete>
<owner>wrong@chromium.org</owner> <owner>wrong@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
...@@ -590,6 +605,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -590,6 +605,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateResultsList.Clicked" <histogram name="Apps.AppList.ZeroStateResultsList.Clicked"
enum="BooleanClicked" expires_after="2021-04-11"> enum="BooleanClicked" expires_after="2021-04-11">
<obsolete>
Removed December 2020.
</obsolete>
<owner>wrong@chromium.org</owner> <owner>wrong@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
...@@ -602,6 +620,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -602,6 +620,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateResultsList.ContainsDriveFiles" <histogram name="Apps.AppList.ZeroStateResultsList.ContainsDriveFiles"
enum="Boolean" expires_after="2021-05-30"> enum="Boolean" expires_after="2021-05-30">
<obsolete>
Removed December 2020.
</obsolete>
<owner>wrong@chromium.org</owner> <owner>wrong@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
...@@ -624,6 +645,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -624,6 +645,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateResultsList.LaunchedItemPositionV2" <histogram name="Apps.AppList.ZeroStateResultsList.LaunchedItemPositionV2"
units="position" expires_after="2021-02-07"> units="position" expires_after="2021-02-07">
<obsolete>
Removed December 2020.
</obsolete>
<owner>wrong@chromium.org</owner> <owner>wrong@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
...@@ -634,6 +658,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -634,6 +658,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppList.ZeroStateResultsList.NumImpressionTypesV2" <histogram name="Apps.AppList.ZeroStateResultsList.NumImpressionTypesV2"
units="count" expires_after="2021-01-03"> units="count" expires_after="2021-01-03">
<obsolete>
Removed December 2020.
</obsolete>
<owner>wrong@chromium.org</owner> <owner>wrong@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>jiameng@chromium.org</owner> <owner>jiameng@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment