summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdsmith <rdsmith@chromium.org>2015-12-14 11:23:01 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-14 19:23:52 +0000
commite2ca0c18f40c746cafc2bb594bd5d8b06341cb1b (patch)
treec0ec3a9a9aedfa60fda10dfed6fdc01d9387a305
parent986e29bfdb8b122d0cce6de9bb2a60e22e58cea1 (diff)
downloadchromium_src-e2ca0c18f40c746cafc2bb594bd5d8b06341cb1b.zip
chromium_src-e2ca0c18f40c746cafc2bb594bd5d8b06341cb1b.tar.gz
chromium_src-e2ca0c18f40c746cafc2bb594bd5d8b06341cb1b.tar.bz2
Include Sdch.UsageInterval* in histograms.xml and fix histogram to deal
with first use and expected range of uses. BUG=None R=bacek@yandex-team.ru Review URL: https://codereview.chromium.org/1515663002 Cr-Commit-Position: refs/heads/master@{#365067}
-rw-r--r--net/sdch/sdch_owner.cc11
-rw-r--r--tools/metrics/histograms/histograms.xml19
2 files changed, 24 insertions, 6 deletions
diff --git a/net/sdch/sdch_owner.cc b/net/sdch/sdch_owner.cc
index ca9b5a7..81936c2 100644
--- a/net/sdch/sdch_owner.cc
+++ b/net/sdch/sdch_owner.cc
@@ -489,12 +489,11 @@ void SdchOwner::OnDictionaryUsed(const std::string& server_hash) {
base::TimeDelta time_since_last_used(now -
base::Time::FromDoubleT(last_used_seconds_since_epoch));
- // TODO(rdsmith): Distinguish between "Never used" and "Actually not
- // touched for 48 hours".
- UMA_HISTOGRAM_CUSTOM_TIMES(
- "Sdch3.UsageInterval",
- use_count ? time_since_last_used : base::TimeDelta::FromHours(48),
- base::TimeDelta(), base::TimeDelta::FromHours(48), 50);
+ if (use_count) {
+ UMA_HISTOGRAM_CUSTOM_TIMES("Sdch3.UsageInterval2", time_since_last_used,
+ base::TimeDelta(), base::TimeDelta::FromDays(7),
+ 50);
+ }
specific_dictionary_map->SetDouble(kDictionaryLastUsedKey, now.ToDoubleT());
specific_dictionary_map->SetInteger(kDictionaryUseCountKey, use_count + 1);
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 24ab831..21544ac 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -42453,6 +42453,25 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
+<histogram name="Sdch3.UsageInterval" units="milliseconds">
+ <owner>rdsmith@chromium.org</owner>
+ <obsolete>
+ Use Sdch3.UsageInterval2 instead.
+ </obsolete>
+ <summary>
+ The amount of time from the last time an SDCH dictionary was used. For the
+ first use of a dictionary, the maximum time is used.
+ </summary>
+</histogram>
+
+<histogram name="Sdch3.UsageInterval2" units="milliseconds">
+ <owner>rdsmith@chromium.org</owner>
+ <summary>
+ The amount of time from the last time an SDCH dictionary was used. Not
+ recorded on first dictionary use.
+ </summary>
+</histogram>
+
<histogram name="Search.AddSearchProvider" enum="AddSearchProvider">
<obsolete>
Use Search.AddSearchProvider2 instead.