Commit 41b81689 authored by tby's avatar tby Committed by Chromium LUCI CQ

Remove obsolete launcher histograms.

This removes these two histograms and the logic related to them:
 Apps.AppListResultLaunchIndexAndQueryLength
 Apps.AppListResultLaunchIsEmptyQuery

Bug: 1160781
Change-Id: Ifcd61df6a40dc6bb910bc7c2a6d27e83a0f84cbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628869Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarThanh Nguyen <thanhdng@chromium.org>
Commit-Queue: Tony Yeoman <tby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844957}
parent 0768c7a2
...@@ -1114,13 +1114,6 @@ void AppListControllerImpl::OpenSearchResult(const std::string& result_id, ...@@ -1114,13 +1114,6 @@ void AppListControllerImpl::OpenSearchResult(const std::string& result_id,
ResetHomeLauncherIfShown(); ResetHomeLauncherIfShown();
} }
void AppListControllerImpl::LogResultLaunchHistogram(
SearchResultLaunchLocation launch_location,
int suggestion_index) {
RecordSearchLaunchIndexAndQueryLength(launch_location, GetLastQueryLength(),
suggestion_index);
}
void AppListControllerImpl::LogSearchAbandonHistogram() { void AppListControllerImpl::LogSearchAbandonHistogram() {
RecordSearchAbandonWithQueryLengthHistogram(GetLastQueryLength()); RecordSearchAbandonWithQueryLengthHistogram(GetLastQueryLength());
} }
......
...@@ -173,8 +173,6 @@ class ASH_EXPORT AppListControllerImpl ...@@ -173,8 +173,6 @@ class ASH_EXPORT AppListControllerImpl
AppListLaunchType launch_type, AppListLaunchType launch_type,
int suggestion_index, int suggestion_index,
bool launch_as_default) override; bool launch_as_default) override;
void LogResultLaunchHistogram(SearchResultLaunchLocation launch_location,
int suggestion_index) override;
void LogSearchAbandonHistogram() override; void LogSearchAbandonHistogram() override;
void InvokeSearchResultAction(const std::string& result_id, void InvokeSearchResultAction(const std::string& result_id,
int action_index) override; int action_index) override;
......
...@@ -108,11 +108,6 @@ aura::Window* GetAppListViewNativeWindow() { ...@@ -108,11 +108,6 @@ aura::Window* GetAppListViewNativeWindow() {
return GetAppListView()->GetWidget()->GetNativeView(); return GetAppListView()->GetWidget()->GetNativeView();
} }
void SetSearchText(AppListControllerImpl* controller, const std::string& text) {
controller->GetSearchModel()->search_box()->Update(base::ASCIIToUTF16(text),
false);
}
} // namespace } // namespace
class AppListControllerImplTest : public AshTestBase { class AppListControllerImplTest : public AshTestBase {
...@@ -1114,39 +1109,6 @@ class AppListControllerImplMetricsTest : public AshTestBase { ...@@ -1114,39 +1109,6 @@ class AppListControllerImplMetricsTest : public AshTestBase {
DISALLOW_COPY_AND_ASSIGN(AppListControllerImplMetricsTest); DISALLOW_COPY_AND_ASSIGN(AppListControllerImplMetricsTest);
}; };
TEST_F(AppListControllerImplMetricsTest, LogSingleResultListClick) {
histogram_tester_.ExpectTotalCount(kAppListResultLaunchIndexAndQueryLength,
0);
SetSearchText(controller_, "");
controller_->LogResultLaunchHistogram(SearchResultLaunchLocation::kResultList,
4);
histogram_tester_.ExpectUniqueSample(kAppListResultLaunchIndexAndQueryLength,
4, 1);
}
TEST_F(AppListControllerImplMetricsTest, LogOneClickInEveryBucket) {
histogram_tester_.ExpectTotalCount(kAppListResultLaunchIndexAndQueryLength,
0);
for (int query_length = 0; query_length < 11; ++query_length) {
const std::string query(query_length, 'a');
for (int click_index = 0; click_index < 7; ++click_index) {
SetSearchText(controller_, query);
controller_->LogResultLaunchHistogram(
SearchResultLaunchLocation::kResultList, click_index);
}
}
histogram_tester_.ExpectTotalCount(kAppListResultLaunchIndexAndQueryLength,
77);
for (int query_length = 0; query_length < 11; ++query_length) {
for (int click_index = 0; click_index < 7; ++click_index) {
histogram_tester_.ExpectBucketCount(
kAppListResultLaunchIndexAndQueryLength,
7 * query_length + click_index, 1);
}
}
}
// One edge case may do harm to the presentation metrics reporter for tablet // One edge case may do harm to the presentation metrics reporter for tablet
// mode: the user may keep pressing on launcher while exiting the tablet mode by // mode: the user may keep pressing on launcher while exiting the tablet mode by
// rotating the lid. In this situation, OnHomeLauncherDragEnd is not triggered. // rotating the lid. In this situation, OnHomeLauncherDragEnd is not triggered.
......
...@@ -16,18 +16,12 @@ ...@@ -16,18 +16,12 @@
#include "ui/compositor/compositor.h" #include "ui/compositor/compositor.h"
namespace ash { namespace ash {
namespace { namespace {
// These constants affect logging, and should not be changed without // This constant affects logging, and should not be changed without
// deprecating the following UMA histograms: // deprecating this UMA histogram:
// - Apps.AppListTileClickIndexAndQueryLength // - Apps.AppListSearchAbandonQueryLength
// - Apps.AppListResultClickIndexAndQueryLength
constexpr int kMaxLoggedQueryLength = 10; constexpr int kMaxLoggedQueryLength = 10;
constexpr int kMaxLoggedSuggestionIndex = 6;
constexpr int kMaxLoggedHistogramValue =
(kMaxLoggedSuggestionIndex + 1) * kMaxLoggedQueryLength +
kMaxLoggedSuggestionIndex;
} // namespace } // namespace
...@@ -160,27 +154,6 @@ APP_LIST_EXPORT void RecordSearchResultOpenSource( ...@@ -160,27 +154,6 @@ APP_LIST_EXPORT void RecordSearchResultOpenSource(
ApplistSearchResultOpenedSource::kMaxApplistSearchResultOpenedSource); ApplistSearchResultOpenedSource::kMaxApplistSearchResultOpenedSource);
} }
void RecordSearchLaunchIndexAndQueryLength(
SearchResultLaunchLocation launch_location,
int query_length,
int suggestion_index) {
if (suggestion_index < 0) {
LOG(ERROR) << "Received invalid suggestion index.";
return;
}
query_length = std::min(query_length, kMaxLoggedQueryLength);
suggestion_index = std::min(suggestion_index, kMaxLoggedSuggestionIndex);
const int logged_value =
(kMaxLoggedSuggestionIndex + 1) * query_length + suggestion_index;
if (launch_location == SearchResultLaunchLocation::kResultList) {
UMA_HISTOGRAM_EXACT_LINEAR(kAppListResultLaunchIndexAndQueryLength,
logged_value, kMaxLoggedHistogramValue);
UMA_HISTOGRAM_BOOLEAN(kAppListResultLaunchIsEmptyQuery, query_length == 0);
}
}
void RecordSearchAbandonWithQueryLengthHistogram(int query_length) { void RecordSearchAbandonWithQueryLengthHistogram(int query_length) {
UMA_HISTOGRAM_EXACT_LINEAR(kSearchAbandonQueryLengthHistogram, UMA_HISTOGRAM_EXACT_LINEAR(kSearchAbandonQueryLengthHistogram,
std::min(query_length, kMaxLoggedQueryLength), std::min(query_length, kMaxLoggedQueryLength),
......
...@@ -64,16 +64,6 @@ constexpr char kAppListPeekingToFullscreenHistogram[] = ...@@ -64,16 +64,6 @@ constexpr char kAppListPeekingToFullscreenHistogram[] =
// The UMA histogram that logs how the app list is shown. // The UMA histogram that logs how the app list is shown.
constexpr char kAppListToggleMethodHistogram[] = "Apps.AppListShowSource"; constexpr char kAppListToggleMethodHistogram[] = "Apps.AppListShowSource";
// The UMA histogram that logs the index launched item in the results list and
// the query length.
constexpr char kAppListResultLaunchIndexAndQueryLength[] =
"Apps.AppListResultLaunchIndexAndQueryLength";
// The UMA histogram that logs if the query that introduces a launch of an item
// in the results list is empty or not.
constexpr char kAppListResultLaunchIsEmptyQuery[] =
"Apps.AppListResultLaunchIsEmptyQuery";
// The UMA histogram that logs the presence or absence of Drive QuickAccess // The UMA histogram that logs the presence or absence of Drive QuickAccess
// search results in the zero-state results list. Differentiates between results // search results in the zero-state results list. Differentiates between results
// existing in the model's results list, but not being displayed in the view. // existing in the model's results list, but not being displayed in the view.
......
...@@ -75,16 +75,6 @@ class ASH_PUBLIC_EXPORT AppListViewDelegate { ...@@ -75,16 +75,6 @@ class ASH_PUBLIC_EXPORT AppListViewDelegate {
int suggestion_index, int suggestion_index,
bool launch_as_default) = 0; bool launch_as_default) = 0;
// Called to log UMA metrics for the launch of an item either in the app tile
// list or the search result list. The |launch_location| argument determines
// which histogram to log to. |suggestion_index| represents the index of the
// launched item in its list view, not the overall position in the suggestion
// window. For instance, the first launcher result item is index 0, regardless
// of if there is an answer card above it.
virtual void LogResultLaunchHistogram(
SearchResultLaunchLocation launch_location,
int suggestion_index) = 0;
// Logs the UMA histogram metrics for user's abandonment of launcher search. // Logs the UMA histogram metrics for user's abandonment of launcher search.
virtual void LogSearchAbandonHistogram() = 0; virtual void LogSearchAbandonHistogram() = 0;
......
...@@ -69,8 +69,6 @@ class AppListTestViewDelegate : public AppListViewDelegate, ...@@ -69,8 +69,6 @@ class AppListTestViewDelegate : public AppListViewDelegate,
ash::AppListLaunchType launch_type, ash::AppListLaunchType launch_type,
int suggestion_index, int suggestion_index,
bool launch_as_default) override; bool launch_as_default) override;
void LogResultLaunchHistogram(SearchResultLaunchLocation launch_location,
int suggestion_index) override {}
void LogSearchAbandonHistogram() override {} void LogSearchAbandonHistogram() override {}
void InvokeSearchResultAction(const std::string& result_id, void InvokeSearchResultAction(const std::string& result_id,
int action_index) override {} int action_index) override {}
......
...@@ -179,8 +179,6 @@ void SearchResultListView::SearchResultActivated(SearchResultView* view, ...@@ -179,8 +179,6 @@ void SearchResultListView::SearchResultActivated(SearchResultView* view,
RecordSearchResultOpenSource(result, view_delegate_->GetModel(), RecordSearchResultOpenSource(result, view_delegate_->GetModel(),
view_delegate_->GetSearchModel()); view_delegate_->GetSearchModel());
view_delegate_->LogResultLaunchHistogram(
SearchResultLaunchLocation::kResultList, view->index_in_container());
view_delegate_->NotifySearchResultsForLogging( view_delegate_->NotifySearchResultsForLogging(
view_delegate_->GetSearchModel()->search_box()->text(), view_delegate_->GetSearchModel()->search_box()->text(),
GetSearchResultsForLogging(search_result_views_), GetSearchResultsForLogging(search_result_views_),
......
...@@ -938,6 +938,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -938,6 +938,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppListResultLaunchIndexAndQueryLength" units="units" <histogram name="Apps.AppListResultLaunchIndexAndQueryLength" units="units"
expires_after="2021-01-31"> expires_after="2021-01-31">
<obsolete>
Removed January 2021.
</obsolete>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<owner>thanhdng@chromium.org</owner> <owner>thanhdng@chromium.org</owner>
<summary> <summary>
...@@ -949,6 +952,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -949,6 +952,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Apps.AppListResultLaunchIsEmptyQuery" enum="Boolean" <histogram name="Apps.AppListResultLaunchIsEmptyQuery" enum="Boolean"
expires_after="2021-11-15"> expires_after="2021-11-15">
<obsolete>
Removed January 2021.
</obsolete>
<owner>thanhdng@chromium.org</owner> <owner>thanhdng@chromium.org</owner>
<owner>tby@chromium.org</owner> <owner>tby@chromium.org</owner>
<summary> <summary>
......
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