OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/prerender/prerender_histograms.h" | 5 #include "chrome/browser/prerender/prerender_histograms.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 // If we observe multiple tags within the 30 second window, we will still | 143 // If we observe multiple tags within the 30 second window, we will still |
144 // reset the window to begin at the most recent occurrence, so that we will | 144 // reset the window to begin at the most recent occurrence, so that we will |
145 // always be in a window in the 30 seconds from each occurrence. | 145 // always be in a window in the 30 seconds from each occurrence. |
146 last_prerender_seen_time_ = GetCurrentTimeTicks(); | 146 last_prerender_seen_time_ = GetCurrentTimeTicks(); |
147 seen_any_pageload_ = false; | 147 seen_any_pageload_ = false; |
148 seen_pageload_started_after_prerender_ = false; | 148 seen_pageload_started_after_prerender_ = false; |
149 } | 149 } |
150 | 150 |
151 void PrerenderHistograms::RecordPrerenderStarted(Origin origin) const { | 151 void PrerenderHistograms::RecordPrerenderStarted(Origin origin) const { |
152 if (OriginIsOmnibox(origin)) { | 152 if (OriginIsOmnibox(origin)) { |
153 UMA_HISTOGRAM_COUNTS( | 153 UMA_HISTOGRAM_ENUMERATION( |
dominich
2012/07/23 19:39:47
I would prefer any of these:
- calling UMA_HISTOG
| |
154 StringPrintf("Prerender.OmniboxPrerenderCount%s", | 154 StringPrintf("Prerender.OmniboxPrerenderCount%s", |
155 PrerenderManager::GetModeString()).c_str(), | 155 PrerenderManager::GetModeString()), 1, 2); |
156 1); | |
157 } | 156 } |
158 } | 157 } |
159 | 158 |
160 void PrerenderHistograms::RecordUsedPrerender(Origin origin) const { | 159 void PrerenderHistograms::RecordUsedPrerender(Origin origin) const { |
161 if (OriginIsOmnibox(origin)) { | 160 if (OriginIsOmnibox(origin)) { |
162 UMA_HISTOGRAM_COUNTS( | 161 UMA_HISTOGRAM_ENUMERATION( |
163 StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", | 162 StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", |
164 PrerenderManager::GetModeString()).c_str(), | 163 PrerenderManager::GetModeString()), 1, 2); |
165 1); | |
166 } | 164 } |
167 } | 165 } |
168 | 166 |
169 void PrerenderHistograms::RecordTimeSinceLastRecentVisit( | 167 void PrerenderHistograms::RecordTimeSinceLastRecentVisit( |
170 base::TimeDelta delta) const { | 168 base::TimeDelta delta) const { |
171 PREFIXED_HISTOGRAM( | 169 PREFIXED_HISTOGRAM( |
172 "TimeSinceLastRecentVisit", | 170 "TimeSinceLastRecentVisit", |
173 UMA_HISTOGRAM_TIMES(name, delta)); | 171 UMA_HISTOGRAM_TIMES(name, delta)); |
174 } | 172 } |
175 | 173 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
404 "LocalPredictorTimeUntilUsed", | 402 "LocalPredictorTimeUntilUsed", |
405 UMA_HISTOGRAM_CUSTOM_TIMES( | 403 UMA_HISTOGRAM_CUSTOM_TIMES( |
406 name, | 404 name, |
407 time_until_used, | 405 time_until_used, |
408 base::TimeDelta::FromMilliseconds(10), | 406 base::TimeDelta::FromMilliseconds(10), |
409 max_age, | 407 max_age, |
410 50)); | 408 50)); |
411 } | 409 } |
412 | 410 |
413 } // namespace prerender | 411 } // namespace prerender |
OLD | NEW |