Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Unified Diff: components/profile_metrics/counts.cc

Issue 1417903006: Componentize ProfileMetrics::Counts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add owners and fix Windows compile Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/profile_metrics/counts.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/profile_metrics/counts.cc
diff --git a/components/profile_metrics/counts.cc b/components/profile_metrics/counts.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9186d042a66550fb180e3ffb9ce73933d0caaa9e
--- /dev/null
+++ b/components/profile_metrics/counts.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 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 "components/profile_metrics/counts.h"
+
+#include "base/metrics/histogram.h"
+
+namespace profile_metrics {
+
+void LogProfileMetricsCounts(const Counts& counts) {
+ UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfiles", counts.total);
+
+ // Ignore other metrics if we have no profiles.
+ if (counts.total > 0) {
+ UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfManagedProfiles",
+ counts.supervised);
+ UMA_HISTOGRAM_COUNTS_100("Profile.PercentageOfManagedProfiles",
+ 100 * counts.supervised / counts.total);
+ UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfSignedInProfiles",
+ counts.signedin);
+ UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfUnusedProfiles", counts.unused);
+ UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfSignedInProfilesWithGAIAIcons",
+ counts.gaia_icon);
+ UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfilesWithAuthErrors",
+ counts.auth_errors);
+ }
+}
+
+} // namespace profile_metrics
« no previous file with comments | « components/profile_metrics/counts.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698