Commit 6d2853eb authored by alex linker's avatar alex linker Committed by Commit Bot

changing app service metrics to use histogram functions rather than

histogram macros

it was recommended by bcwhite@ on another cl to change all the macro
calls to function calls to avoid instantiating the caching code.

BUG=1044710

Change-Id: I1e6dfd9caa2f8250892a7505f30398a50f243483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2040632Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: Alex Linker <ajlinker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739071}
parent ce119086
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "ash/public/cpp/app_list/internal_app_id_constants.h" #include "ash/public/cpp/app_list/internal_app_id_constants.h"
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/chromeos/extensions/default_web_app_ids.h" #include "chrome/browser/chromeos/extensions/default_web_app_ids.h"
#include "chrome/browser/chromeos/file_manager/app_id.h" #include "chrome/browser/chromeos/file_manager/app_id.h"
...@@ -45,45 +44,45 @@ void RecordDefaultAppLaunch(DefaultAppName default_app_name, ...@@ -45,45 +44,45 @@ void RecordDefaultAppLaunch(DefaultAppName default_app_name,
case apps::mojom::LaunchSource::kFromParentalControls: case apps::mojom::LaunchSource::kFromParentalControls:
return; return;
case apps::mojom::LaunchSource::kFromAppListGrid: case apps::mojom::LaunchSource::kFromAppListGrid:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromAppListGrid", base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromAppListGrid",
default_app_name); default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromAppListGridContextMenu: case apps::mojom::LaunchSource::kFromAppListGridContextMenu:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Apps.DefaultAppLaunch.FromAppListGridContextMenu", default_app_name); "Apps.DefaultAppLaunch.FromAppListGridContextMenu", default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromAppListQuery: case apps::mojom::LaunchSource::kFromAppListQuery:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromAppListQuery", base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromAppListQuery",
default_app_name); default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromAppListQueryContextMenu: case apps::mojom::LaunchSource::kFromAppListQueryContextMenu:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Apps.DefaultAppLaunch.FromAppListQueryContextMenu", "Apps.DefaultAppLaunch.FromAppListQueryContextMenu",
default_app_name); default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromAppListRecommendation: case apps::mojom::LaunchSource::kFromAppListRecommendation:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Apps.DefaultAppLaunch.FromAppListRecommendation", default_app_name); "Apps.DefaultAppLaunch.FromAppListRecommendation", default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromShelf: case apps::mojom::LaunchSource::kFromShelf:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromShelf", base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromShelf",
default_app_name); default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromFileManager: case apps::mojom::LaunchSource::kFromFileManager:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromFileManager", base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromFileManager",
default_app_name); default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromLink: case apps::mojom::LaunchSource::kFromLink:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromLink", base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromLink",
default_app_name); default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromOmnibox: case apps::mojom::LaunchSource::kFromOmnibox:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromOmnibox", base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromOmnibox",
default_app_name); default_app_name);
break; break;
case apps::mojom::LaunchSource::kFromChromeInternal: case apps::mojom::LaunchSource::kFromChromeInternal:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromChromeInternal", base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromChromeInternal",
default_app_name); default_app_name);
break; break;
} }
} }
...@@ -96,14 +95,14 @@ void RecordBuiltInAppLaunch(apps::BuiltInAppName built_in_app_name, ...@@ -96,14 +95,14 @@ void RecordBuiltInAppLaunch(apps::BuiltInAppName built_in_app_name,
break; break;
case apps::mojom::LaunchSource::kFromAppListGrid: case apps::mojom::LaunchSource::kFromAppListGrid:
case apps::mojom::LaunchSource::kFromAppListGridContextMenu: case apps::mojom::LaunchSource::kFromAppListGridContextMenu:
UMA_HISTOGRAM_ENUMERATION("Apps.AppListInternalApp.Activate", base::UmaHistogramEnumeration("Apps.AppListInternalApp.Activate",
built_in_app_name); built_in_app_name);
break; break;
case apps::mojom::LaunchSource::kFromAppListQuery: case apps::mojom::LaunchSource::kFromAppListQuery:
case apps::mojom::LaunchSource::kFromAppListQueryContextMenu: case apps::mojom::LaunchSource::kFromAppListQueryContextMenu:
case apps::mojom::LaunchSource::kFromAppListRecommendation: case apps::mojom::LaunchSource::kFromAppListRecommendation:
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Open", base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Open",
built_in_app_name); built_in_app_name);
break; break;
case apps::mojom::LaunchSource::kFromShelf: case apps::mojom::LaunchSource::kFromShelf:
case apps::mojom::LaunchSource::kFromFileManager: case apps::mojom::LaunchSource::kFromFileManager:
...@@ -159,25 +158,25 @@ void RecordAppLaunch(const std::string& app_id, ...@@ -159,25 +158,25 @@ void RecordAppLaunch(const std::string& app_id,
void RecordBuiltInAppSearchResult(const std::string& app_id) { void RecordBuiltInAppSearchResult(const std::string& app_id) {
if (app_id == ash::kInternalAppIdKeyboardShortcutViewer) { if (app_id == ash::kInternalAppIdKeyboardShortcutViewer) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show", base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kKeyboardShortcutViewer); BuiltInAppName::kKeyboardShortcutViewer);
} else if (app_id == ash::kInternalAppIdSettings) { } else if (app_id == ash::kInternalAppIdSettings) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show", base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kSettings); BuiltInAppName::kSettings);
} else if (app_id == ash::kInternalAppIdContinueReading) { } else if (app_id == ash::kInternalAppIdContinueReading) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show", base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kContinueReading); BuiltInAppName::kContinueReading);
} else if (app_id == ash::kInternalAppIdDiscover) { } else if (app_id == ash::kInternalAppIdDiscover) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show", base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kDiscover); BuiltInAppName::kDiscover);
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
} else if (app_id == plugin_vm::kPluginVmAppId) { } else if (app_id == plugin_vm::kPluginVmAppId) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show", base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kPluginVm); BuiltInAppName::kPluginVm);
#endif // OS_CHROMEOS #endif // OS_CHROMEOS
} else if (app_id == ash::kReleaseNotesAppId) { } else if (app_id == ash::kReleaseNotesAppId) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show", base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kReleaseNotes); BuiltInAppName::kReleaseNotes);
} }
} }
......
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