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

Unified Diff: components/safe_browsing_db/v4_store.cc

Issue 2423523003: Small: Add store specific histograms also. (Closed)
Patch Set: Update the comment about histogram naming Created 4 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/safe_browsing_db/v4_local_database_manager.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_store.cc
diff --git a/components/safe_browsing_db/v4_store.cc b/components/safe_browsing_db/v4_store.cc
index 81f30ec7cc066c162c19f28f9f5c048ea9fde9ac..273b04644a2e73208d4fac23a786e0ce6a6cc7f9 100644
--- a/components/safe_browsing_db/v4_store.cc
+++ b/components/safe_browsing_db/v4_store.cc
@@ -36,8 +36,12 @@ const char kMergeUpdate[] = ".MergeUpdate";
// Part 3: Represent the unit of value being measured and logged.
const char kResult[] = ".Result";
const char kTime[] = ".Time";
+// Part 4 (optional): Represent the name of the list for which the metric is
+// being logged. For instance, ".UrlSoceng".
// UMA metric names for this file are generated by appending one value each,
-// in order, from parts 1, 2, and 3.
+// in order, from parts [1, 2, and 3], or [1, 2, 3, and 4]. For example:
+// SafeBrowsing.V4ProcessPartialUpdate.ApplyUpdate.Result, or
+// SafeBrowsing.V4ProcessPartialUpdate.ApplyUpdate.Result.UrlSoceng
const uint32_t kFileMagic = 0x600D71FE;
const uint32_t kFileVersion = 9;
@@ -65,7 +69,7 @@ void RecordTimeWithAndWithoutSuffix(const std::string& metric,
std::string suffix = GetUmaSuffixForStore(file_path);
base::HistogramBase* histogram_suffix = base::Histogram::FactoryTimeGet(
- metric + suffix + kTime, base::TimeDelta::FromMilliseconds(1),
+ metric + kTime + suffix, base::TimeDelta::FromMilliseconds(1),
base::TimeDelta::FromMinutes(1), kBucketCount,
base::HistogramBase::kUmaTargetedHistogramFlag);
if (histogram_suffix) {
@@ -89,7 +93,7 @@ void RecordEnumWithAndWithoutSuffix(const std::string& metric,
std::string suffix = GetUmaSuffixForStore(file_path);
base::HistogramBase* histogram_suffix = base::LinearHistogram::FactoryGet(
- metric + suffix + kResult, 1, maximum, maximum + 1,
+ metric + kResult + suffix, 1, maximum, maximum + 1,
base::HistogramBase::kUmaTargetedHistogramFlag);
if (histogram_suffix) {
histogram_suffix->Add(value);
« no previous file with comments | « components/safe_browsing_db/v4_local_database_manager.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698