Commit 6af4e57d authored by Thanh Nguyen's avatar Thanh Nguyen Committed by Commit Bot

[cros-fuzzy-app] Add metrics

This CL adds required metrics for Improved App Search on Chrome OS
project.

Bug: 990684
Change-Id: I8c940317af0ef1bca1856ee3790d53b6e96b321a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850678
Commit-Queue: Thanh Nguyen <thanhdng@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarJia Meng <jiameng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707165}
parent 748ef909
......@@ -28,6 +28,13 @@ const char kAppListZeroStateSuggestionOpenTypeHistogram[] =
// launcher issues to the search providers.
constexpr char kAppListLauncherIssuedSearchQueryLength[] =
"Apps.AppListLauncherIssuedSearchQueryLength";
// The UMA histogram that logs the length of the query that resulted in an app
// launch from search box.
constexpr char kSearchQueryLengthAppLaunch[] =
"Apps.AppList.SearchQueryLength.Apps";
// The UMA histogram that logs the number of app launches from the search box
// with non-empty queries.
constexpr char kSearchSuccessAppLaunch[] = "Apps.AppList.SearchSuccess.Apps";
// Maximum query length logged for user typed query in characters.
constexpr int kMaxLoggedUserQueryLength = 20;
......@@ -91,4 +98,13 @@ void RecordLauncherIssuedSearchQueryLength(int query_length) {
}
}
void RecordSuccessfulAppLaunchUsingSearch(
ash::AppListLaunchedFrom launched_from,
int query_length) {
if (query_length > 0) {
UMA_HISTOGRAM_ENUMERATION(kSearchSuccessAppLaunch, launched_from);
UMA_HISTOGRAM_COUNTS_100(kSearchQueryLengthAppLaunch, query_length);
}
}
} // namespace ash
......@@ -94,6 +94,10 @@ ASH_PUBLIC_EXPORT void RecordZeroStateSuggestionOpenTypeHistogram(
ASH_PUBLIC_EXPORT void RecordLauncherIssuedSearchQueryLength(int query_length);
ASH_PUBLIC_EXPORT void RecordSuccessfulAppLaunchUsingSearch(
ash::AppListLaunchedFrom launched_from,
int query_length);
} // namespace ash
#endif // ASH_PUBLIC_CPP_APP_LIST_APP_LIST_METRICS_H_
......@@ -112,6 +112,15 @@ void AppListClientImpl::OpenSearchResult(const std::string& result_id,
app_list::RankingItemTypeFromSearchResult(*result);
app_launch_data.launch_type = launch_type;
app_launch_data.launched_from = launched_from;
if (launch_type == ash::AppListLaunchType::kAppSearchResult &&
launched_from == ash::AppListLaunchedFrom::kLaunchedFromSearchBox &&
app_launch_data.ranking_item_type == app_list::RankingItemType::kApp &&
search_controller_->GetLastQueryLength() != 0) {
ash::RecordSuccessfulAppLaunchUsingSearch(
launched_from, search_controller_->GetLastQueryLength());
}
// Send training signal to search controller.
search_controller_->Train(std::move(app_launch_data));
......
......@@ -5109,6 +5109,25 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Apps.AppList.SearchQueryLength.Apps" units="characters"
expires_after="2020-04-29">
<owner>thanhdng@chromium.org</owner>
<owner>jiameng@chromium.org</owner>
<summary>
The length of the query that resulted in an app launch from search box. This
metric only records non-empty queries.
</summary>
</histogram>
<histogram name="Apps.AppList.SearchSuccess.Apps" enum="AppListLaunchedFrom"
expires_after="2020-04-29">
<owner>thanhdng@chromium.org</owner>
<owner>jiameng@chromium.org</owner>
<summary>
The number of app launches from the search box with non-empty queries.
</summary>
</histogram>
<histogram name="Apps.AppList.ZeroStateFileProvider.Latency" units="ms"
expires_after="2020-03-29">
<owner>wrong@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