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/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
13 #include "chrome/browser/predictors/autocomplete_action_predictor.h" | 13 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
14 #include "chrome/browser/prerender/prerender_field_trial.h" | 14 #include "chrome/browser/prerender/prerender_field_trial.h" |
15 #include "chrome/browser/prerender/prerender_manager.h" | 15 #include "chrome/browser/prerender/prerender_manager.h" |
16 #include "chrome/browser/prerender/prerender_util.h" | 16 #include "chrome/browser/prerender/prerender_util.h" |
17 | 17 |
18 using predictors::AutocompleteActionPredictor; | 18 using predictors::AutocompleteActionPredictor; |
19 | 19 |
20 namespace prerender { | 20 namespace prerender { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // Time window for which we will record windowed PLT's from the last | 24 // Time window for which we will record windowed PLTs from the last observed |
25 // observed link rel=prefetch tag. | 25 // link rel=prefetch tag. This is not intended to be the same as the prerender |
| 26 // ttl, it's just intended to be a window during which a prerender has likely |
| 27 // affected performance. |
26 const int kWindowDurationSeconds = 30; | 28 const int kWindowDurationSeconds = 30; |
27 | 29 |
28 std::string ComposeHistogramName(const std::string& prefix_type, | 30 std::string ComposeHistogramName(const std::string& prefix_type, |
29 const std::string& name) { | 31 const std::string& name) { |
30 if (prefix_type.empty()) | 32 if (prefix_type.empty()) |
31 return std::string("Prerender.") + name; | 33 return std::string("Prerender.") + name; |
32 return std::string("Prerender.") + prefix_type + std::string("_") + name; | 34 return std::string("Prerender.") + prefix_type + std::string("_") + name; |
33 } | 35 } |
34 | 36 |
35 std::string GetHistogramName(Origin origin, uint8 experiment_id, | 37 std::string GetHistogramName(Origin origin, uint8 experiment_id, |
36 bool is_wash, const std::string& name) { | 38 bool is_wash, const std::string& name) { |
37 if (is_wash) | 39 if (is_wash) |
38 return ComposeHistogramName("wash", name); | 40 return ComposeHistogramName("wash", name); |
39 | 41 |
40 if (origin == ORIGIN_GWS_PRERENDER) { | 42 if (origin == ORIGIN_GWS_PRERENDER) { |
41 if (experiment_id == kNoExperiment) | 43 if (experiment_id == kNoExperiment) |
42 return ComposeHistogramName("gws", name); | 44 return ComposeHistogramName("gws", name); |
43 return ComposeHistogramName("exp" + std::string(1, experiment_id + '0'), | 45 return ComposeHistogramName("exp" + std::string(1, experiment_id + '0'), |
44 name); | 46 name); |
45 } | 47 } |
46 | 48 |
47 if (experiment_id != kNoExperiment) | 49 if (experiment_id != kNoExperiment) |
48 return ComposeHistogramName("wash", name); | 50 return ComposeHistogramName("wash", name); |
49 | 51 |
50 switch (origin) { | 52 switch (origin) { |
51 case ORIGIN_OMNIBOX: | 53 case ORIGIN_OMNIBOX: |
52 return ComposeHistogramName("omnibox", name); | 54 return ComposeHistogramName("omnibox", name); |
53 case ORIGIN_LINK_REL_PRERENDER: | 55 case ORIGIN_LINK_REL_PRERENDER: |
54 return ComposeHistogramName("web", name); | 56 return ComposeHistogramName("web", name); |
| 57 case ORIGIN_NONE: |
| 58 return ComposeHistogramName("none", name); |
55 case ORIGIN_GWS_PRERENDER: // Handled above. | 59 case ORIGIN_GWS_PRERENDER: // Handled above. |
56 default: | 60 default: |
57 NOTREACHED(); | 61 NOTREACHED(); |
58 break; | 62 break; |
59 }; | 63 }; |
60 | 64 |
61 // Dummy return value to make the compiler happy. | 65 // Dummy return value to make the compiler happy. |
62 NOTREACHED(); | 66 NOTREACHED(); |
63 return ComposeHistogramName("wash", name); | 67 return ComposeHistogramName("wash", name); |
64 } | 68 } |
65 | 69 |
66 bool OriginIsOmnibox(Origin origin) { | 70 bool OriginIsOmnibox(Origin origin) { |
67 return origin == ORIGIN_OMNIBOX; | 71 return origin == ORIGIN_OMNIBOX; |
68 } | 72 } |
69 | 73 |
70 } // namespace | 74 } // namespace |
71 | 75 |
72 // Helper macros for experiment-based and origin-based histogram reporting. | 76 // Helper macros for experiment-based and origin-based histogram reporting. |
73 // All HISTOGRAM arguments must be UMA_HISTOGRAM... macros that contain an | 77 // All HISTOGRAM arguments must be UMA_HISTOGRAM... macros that contain an |
74 // argument "name" which these macros will eventually substitute for the | 78 // argument "name" which these macros will eventually substitute for the |
75 // actual name used. | 79 // actual name used. |
76 #define PREFIXED_HISTOGRAM(histogram_name, HISTOGRAM) \ | 80 #define PREFIXED_HISTOGRAM(histogram_name, origin, HISTOGRAM) \ |
77 PREFIXED_HISTOGRAM_INTERNAL(GetCurrentOrigin(), GetCurrentExperimentId(), \ | 81 PREFIXED_HISTOGRAM_INTERNAL(origin, GetCurrentExperimentId(), \ |
78 IsOriginExperimentWash(), HISTOGRAM, \ | 82 IsOriginExperimentWash(), HISTOGRAM, \ |
79 histogram_name) | 83 histogram_name) |
80 | 84 |
81 #define PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT(histogram_name, origin, \ | 85 #define PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT(histogram_name, origin, \ |
82 experiment, HISTOGRAM) \ | 86 experiment, HISTOGRAM) \ |
83 PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, false, HISTOGRAM, \ | 87 PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, false, HISTOGRAM, \ |
84 histogram_name) | 88 histogram_name) |
85 | 89 |
86 #define PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, wash, HISTOGRAM, \ | 90 #define PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, wash, HISTOGRAM, \ |
87 histogram_name) { \ | 91 histogram_name) { \ |
(...skipping 10 matching lines...) Expand all Loading... |
98 recording_experiment = experiment; \ | 102 recording_experiment = experiment; \ |
99 if (wash) { \ | 103 if (wash) { \ |
100 HISTOGRAM; \ | 104 HISTOGRAM; \ |
101 } else if (experiment != kNoExperiment && \ | 105 } else if (experiment != kNoExperiment && \ |
102 (origin != ORIGIN_GWS_PRERENDER || \ | 106 (origin != ORIGIN_GWS_PRERENDER || \ |
103 experiment != recording_experiment)) { \ | 107 experiment != recording_experiment)) { \ |
104 } else if (origin == ORIGIN_LINK_REL_PRERENDER) { \ | 108 } else if (origin == ORIGIN_LINK_REL_PRERENDER) { \ |
105 HISTOGRAM; \ | 109 HISTOGRAM; \ |
106 } else if (origin == ORIGIN_OMNIBOX) { \ | 110 } else if (origin == ORIGIN_OMNIBOX) { \ |
107 HISTOGRAM; \ | 111 HISTOGRAM; \ |
| 112 } else if (origin == ORIGIN_NONE) { \ |
| 113 HISTOGRAM; \ |
108 } else if (experiment != kNoExperiment) { \ | 114 } else if (experiment != kNoExperiment) { \ |
109 HISTOGRAM; \ | 115 HISTOGRAM; \ |
110 } else { \ | 116 } else { \ |
111 HISTOGRAM; \ | 117 HISTOGRAM; \ |
112 } \ | 118 } \ |
113 } | 119 } |
114 | 120 |
115 PrerenderHistograms::PrerenderHistograms() | 121 PrerenderHistograms::PrerenderHistograms() |
116 : last_experiment_id_(kNoExperiment), | 122 : last_experiment_id_(kNoExperiment), |
117 last_origin_(ORIGIN_LINK_REL_PRERENDER), | 123 last_origin_(ORIGIN_LINK_REL_PRERENDER), |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 177 |
172 void PrerenderHistograms::RecordUsedPrerender(Origin origin) const { | 178 void PrerenderHistograms::RecordUsedPrerender(Origin origin) const { |
173 if (OriginIsOmnibox(origin)) { | 179 if (OriginIsOmnibox(origin)) { |
174 UMA_HISTOGRAM_ENUMERATION( | 180 UMA_HISTOGRAM_ENUMERATION( |
175 StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", | 181 StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", |
176 PrerenderManager::GetModeString()), 1, 2); | 182 PrerenderManager::GetModeString()), 1, 2); |
177 } | 183 } |
178 } | 184 } |
179 | 185 |
180 void PrerenderHistograms::RecordTimeSinceLastRecentVisit( | 186 void PrerenderHistograms::RecordTimeSinceLastRecentVisit( |
| 187 Origin origin, |
181 base::TimeDelta delta) const { | 188 base::TimeDelta delta) const { |
182 PREFIXED_HISTOGRAM( | 189 PREFIXED_HISTOGRAM( |
183 "TimeSinceLastRecentVisit", | 190 "TimeSinceLastRecentVisit", origin, |
184 UMA_HISTOGRAM_TIMES(name, delta)); | 191 UMA_HISTOGRAM_TIMES(name, delta)); |
185 } | 192 } |
186 | 193 |
187 void PrerenderHistograms::RecordFractionPixelsFinalAtSwapin( | 194 void PrerenderHistograms::RecordFractionPixelsFinalAtSwapin( |
| 195 Origin origin, |
188 double fraction) const { | 196 double fraction) const { |
189 if (fraction < 0.0 || fraction > 1.0) | 197 if (fraction < 0.0 || fraction > 1.0) |
190 return; | 198 return; |
191 int percentage = static_cast<int>(fraction * 100); | 199 int percentage = static_cast<int>(fraction * 100); |
192 if (percentage < 0 || percentage > 100) | 200 if (percentage < 0 || percentage > 100) |
193 return; | 201 return; |
194 PREFIXED_HISTOGRAM( | 202 PREFIXED_HISTOGRAM( |
195 base::FieldTrial::MakeName("FractionPixelsFinalAtSwapin", "Prerender"), | 203 base::FieldTrial::MakeName("FractionPixelsFinalAtSwapin", "Prerender"), |
196 UMA_HISTOGRAM_PERCENTAGE(name, percentage)); | 204 origin, UMA_HISTOGRAM_PERCENTAGE(name, percentage)); |
197 } | 205 } |
198 | 206 |
199 base::TimeTicks PrerenderHistograms::GetCurrentTimeTicks() const { | 207 base::TimeTicks PrerenderHistograms::GetCurrentTimeTicks() const { |
200 return base::TimeTicks::Now(); | 208 return base::TimeTicks::Now(); |
201 } | 209 } |
202 | 210 |
203 // Helper macro for histograms. | 211 // Helper macro for histograms. |
204 #define RECORD_PLT(tag, perceived_page_load_time) { \ | 212 #define RECORD_PLT(tag, perceived_page_load_time) { \ |
205 PREFIXED_HISTOGRAM( \ | 213 PREFIXED_HISTOGRAM( \ |
206 base::FieldTrial::MakeName(tag, "Prerender"), \ | 214 base::FieldTrial::MakeName(tag, "Prerender"), origin, \ |
207 UMA_HISTOGRAM_CUSTOM_TIMES( \ | 215 UMA_HISTOGRAM_CUSTOM_TIMES( \ |
208 name, \ | 216 name, \ |
209 perceived_page_load_time, \ | 217 perceived_page_load_time, \ |
210 base::TimeDelta::FromMilliseconds(10), \ | 218 base::TimeDelta::FromMilliseconds(10), \ |
211 base::TimeDelta::FromSeconds(60), \ | 219 base::TimeDelta::FromSeconds(60), \ |
212 100)); \ | 220 100)); \ |
213 } | 221 } |
214 | 222 |
215 // Summary of all histograms Perceived PLT histograms: | 223 // Summary of all histograms Perceived PLT histograms: |
216 // (all prefixed PerceivedPLT) | 224 // (all prefixed PerceivedPLT) |
217 // PerceivedPLT -- Perceived Pageloadtimes (PPLT) for all pages in the group. | 225 // PerceivedPLT -- Perceived Pageloadtimes (PPLT) for all pages in the group. |
(...skipping 11 matching lines...) Expand all Loading... |
229 // triggering for the first page to finish after the prerender that also started | 237 // triggering for the first page to finish after the prerender that also started |
230 // after the prerender started. | 238 // after the prerender started. |
231 // ...FirstAfterMissBoth -- pages meeting | 239 // ...FirstAfterMissBoth -- pages meeting |
232 // FirstAfterMiss AND FirstAfterMissNonOverlapping | 240 // FirstAfterMiss AND FirstAfterMissNonOverlapping |
233 // ...FirstAfterMissAnyOnly -- pages meeting | 241 // ...FirstAfterMissAnyOnly -- pages meeting |
234 // FirstAfterMiss but NOT FirstAfterMissNonOverlapping | 242 // FirstAfterMiss but NOT FirstAfterMissNonOverlapping |
235 // ..FirstAfterMissNonOverlappingOnly -- pages meeting | 243 // ..FirstAfterMissNonOverlappingOnly -- pages meeting |
236 // FirstAfterMissNonOverlapping but NOT FirstAfterMiss | 244 // FirstAfterMissNonOverlapping but NOT FirstAfterMiss |
237 | 245 |
238 void PrerenderHistograms::RecordPerceivedPageLoadTime( | 246 void PrerenderHistograms::RecordPerceivedPageLoadTime( |
239 base::TimeDelta perceived_page_load_time, bool was_prerender, | 247 Origin origin, |
| 248 base::TimeDelta perceived_page_load_time, |
| 249 bool was_prerender, |
240 bool was_complete_prerender, const GURL& url) { | 250 bool was_complete_prerender, const GURL& url) { |
241 if (!IsWebURL(url)) | 251 if (!IsWebURL(url)) |
242 return; | 252 return; |
243 bool within_window = WithinWindow(); | 253 bool within_window = WithinWindow(); |
244 bool is_google_url = IsGoogleDomain(url); | 254 bool is_google_url = IsGoogleDomain(url); |
245 RECORD_PLT("PerceivedPLT", perceived_page_load_time); | 255 RECORD_PLT("PerceivedPLT", perceived_page_load_time); |
246 if (within_window) | 256 if (within_window) |
247 RECORD_PLT("PerceivedPLTWindowed", perceived_page_load_time); | 257 RECORD_PLT("PerceivedPLTWindowed", perceived_page_load_time); |
248 if (was_prerender || was_complete_prerender) { | 258 if (was_prerender || was_complete_prerender) { |
249 if (was_prerender) | 259 if (was_prerender) |
(...skipping 29 matching lines...) Expand all Loading... |
279 } else if (recorded_non_overlapping) { | 289 } else if (recorded_non_overlapping) { |
280 RECORD_PLT("PerceivedPLTFirstAfterMissNonOverlappingOnly", | 290 RECORD_PLT("PerceivedPLTFirstAfterMissNonOverlappingOnly", |
281 perceived_page_load_time); | 291 perceived_page_load_time); |
282 } | 292 } |
283 } | 293 } |
284 } | 294 } |
285 } | 295 } |
286 } | 296 } |
287 | 297 |
288 void PrerenderHistograms::RecordPageLoadTimeNotSwappedIn( | 298 void PrerenderHistograms::RecordPageLoadTimeNotSwappedIn( |
289 base::TimeDelta page_load_time, const GURL& url) const { | 299 Origin origin, |
| 300 base::TimeDelta page_load_time, |
| 301 const GURL& url) const { |
290 // If the URL to be prerendered is not a http[s] URL, or is a Google URL, | 302 // If the URL to be prerendered is not a http[s] URL, or is a Google URL, |
291 // do not record. | 303 // do not record. |
292 if (!IsWebURL(url) || IsGoogleDomain(url)) | 304 if (!IsWebURL(url) || IsGoogleDomain(url)) |
293 return; | 305 return; |
294 RECORD_PLT("PrerenderNotSwappedInPLT", page_load_time); | 306 RECORD_PLT("PrerenderNotSwappedInPLT", page_load_time); |
295 } | 307 } |
296 | 308 |
297 void PrerenderHistograms::RecordSimulatedLocalBrowsingBaselinePLT( | 309 void PrerenderHistograms::RecordPercentLoadDoneAtSwapin(Origin origin, |
298 base::TimeDelta page_load_time, const GURL& url) const { | 310 double fraction) const { |
299 // If the URL to be prerendered is not a http[s] URL do not record. | |
300 if (!IsWebURL(url)) | |
301 return; | |
302 RECORD_PLT("SimulatedLocalBrowsingBaselinePLT", page_load_time); | |
303 } | |
304 | |
305 void PrerenderHistograms::RecordSimulatedLocalBrowsingPLT( | |
306 base::TimeDelta page_load_time, const GURL& url) const { | |
307 // If the URL to be prerendered is not a http[s] URL do not record. | |
308 if (!IsWebURL(url)) | |
309 return; | |
310 RECORD_PLT("SimulatedLocalBrowsingPLT", page_load_time); | |
311 } | |
312 | |
313 void PrerenderHistograms::RecordPercentLoadDoneAtSwapin(double fraction) | |
314 const { | |
315 if (fraction < 0.0 || fraction > 1.0) | 311 if (fraction < 0.0 || fraction > 1.0) |
316 return; | 312 return; |
317 int percentage = static_cast<int>(fraction * 100); | 313 int percentage = static_cast<int>(fraction * 100); |
318 if (percentage < 0 || percentage > 100) | 314 if (percentage < 0 || percentage > 100) |
319 return; | 315 return; |
320 PREFIXED_HISTOGRAM( | 316 PREFIXED_HISTOGRAM( |
321 base::FieldTrial::MakeName("PercentLoadDoneAtSwapin", "Prerender"), | 317 base::FieldTrial::MakeName("PercentLoadDoneAtSwapin", "Prerender"), |
322 UMA_HISTOGRAM_PERCENTAGE(name, percentage)); | 318 origin, UMA_HISTOGRAM_PERCENTAGE(name, percentage)); |
323 } | 319 } |
324 | 320 |
325 base::TimeDelta PrerenderHistograms::GetTimeSinceLastPrerender() const { | 321 base::TimeDelta PrerenderHistograms::GetTimeSinceLastPrerender() const { |
326 return base::TimeTicks::Now() - last_prerender_seen_time_; | 322 return base::TimeTicks::Now() - last_prerender_seen_time_; |
327 } | 323 } |
328 | 324 |
329 bool PrerenderHistograms::WithinWindow() const { | 325 bool PrerenderHistograms::WithinWindow() const { |
330 if (last_prerender_seen_time_.is_null()) | 326 if (last_prerender_seen_time_.is_null()) |
331 return false; | 327 return false; |
332 return GetTimeSinceLastPrerender() <= | 328 return GetTimeSinceLastPrerender() <= |
333 base::TimeDelta::FromSeconds(kWindowDurationSeconds); | 329 base::TimeDelta::FromSeconds(kWindowDurationSeconds); |
334 } | 330 } |
335 | 331 |
336 void PrerenderHistograms::RecordTimeUntilUsed( | 332 void PrerenderHistograms::RecordTimeUntilUsed( |
| 333 Origin origin, |
337 base::TimeDelta time_until_used, | 334 base::TimeDelta time_until_used, |
338 base::TimeDelta time_to_live) const { | 335 base::TimeDelta time_to_live) const { |
339 PREFIXED_HISTOGRAM( | 336 PREFIXED_HISTOGRAM( |
340 "TimeUntilUsed", | 337 "TimeUntilUsed", origin, |
341 UMA_HISTOGRAM_CUSTOM_TIMES( | 338 UMA_HISTOGRAM_CUSTOM_TIMES( |
342 name, | 339 name, |
343 time_until_used, | 340 time_until_used, |
344 base::TimeDelta::FromMilliseconds(10), | 341 base::TimeDelta::FromMilliseconds(10), |
345 time_to_live, | 342 time_to_live, |
346 50)); | 343 50)); |
347 } | 344 } |
348 | 345 |
349 void PrerenderHistograms::RecordPerSessionCount(int count) const { | 346 void PrerenderHistograms::RecordPerSessionCount(Origin origin, |
| 347 int count) const { |
350 PREFIXED_HISTOGRAM( | 348 PREFIXED_HISTOGRAM( |
351 "PrerendersPerSessionCount", | 349 "PrerendersPerSessionCount", origin, |
352 UMA_HISTOGRAM_COUNTS(name, count)); | 350 UMA_HISTOGRAM_COUNTS(name, count)); |
353 } | 351 } |
354 | 352 |
355 void PrerenderHistograms::RecordTimeBetweenPrerenderRequests( | 353 void PrerenderHistograms::RecordTimeBetweenPrerenderRequests( |
356 base::TimeDelta time) const { | 354 Origin origin, base::TimeDelta time) const { |
357 PREFIXED_HISTOGRAM( | 355 PREFIXED_HISTOGRAM( |
358 "TimeBetweenPrerenderRequests", | 356 "TimeBetweenPrerenderRequests", origin, |
359 UMA_HISTOGRAM_TIMES(name, time)); | 357 UMA_HISTOGRAM_TIMES(name, time)); |
360 } | 358 } |
361 | 359 |
362 void PrerenderHistograms::RecordFinalStatus( | 360 void PrerenderHistograms::RecordFinalStatus( |
363 Origin origin, | 361 Origin origin, |
364 uint8 experiment_id, | 362 uint8 experiment_id, |
365 PrerenderContents::MatchCompleteStatus mc_status, | 363 PrerenderContents::MatchCompleteStatus mc_status, |
366 FinalStatus final_status) const { | 364 FinalStatus final_status) const { |
367 DCHECK(final_status != FINAL_STATUS_MAX); | 365 DCHECK(final_status != FINAL_STATUS_MAX); |
368 | 366 |
(...skipping 13 matching lines...) Expand all Loading... |
382 UMA_HISTOGRAM_ENUMERATION(name, final_status, FINAL_STATUS_MAX)); | 380 UMA_HISTOGRAM_ENUMERATION(name, final_status, FINAL_STATUS_MAX)); |
383 } | 381 } |
384 } | 382 } |
385 | 383 |
386 uint8 PrerenderHistograms::GetCurrentExperimentId() const { | 384 uint8 PrerenderHistograms::GetCurrentExperimentId() const { |
387 if (!WithinWindow()) | 385 if (!WithinWindow()) |
388 return kNoExperiment; | 386 return kNoExperiment; |
389 return last_experiment_id_; | 387 return last_experiment_id_; |
390 } | 388 } |
391 | 389 |
392 Origin PrerenderHistograms::GetCurrentOrigin() const { | |
393 if (!WithinWindow()) | |
394 return ORIGIN_LINK_REL_PRERENDER; | |
395 return last_origin_; | |
396 } | |
397 | |
398 bool PrerenderHistograms::IsOriginExperimentWash() const { | 390 bool PrerenderHistograms::IsOriginExperimentWash() const { |
399 if (!WithinWindow()) | 391 if (!WithinWindow()) |
400 return false; | 392 return false; |
401 return origin_experiment_wash_; | 393 return origin_experiment_wash_; |
402 } | 394 } |
403 | 395 |
404 void PrerenderHistograms::RecordLocalPredictorEvent( | |
405 PrerenderLocalPredictor::Event event) const { | |
406 UMA_HISTOGRAM_ENUMERATION( | |
407 ComposeHistogramName("", base::FieldTrial::MakeName( | |
408 "LocalPredictorEvent", "Prerender")), | |
409 event, | |
410 PrerenderLocalPredictor::EVENT_MAX_VALUE); | |
411 } | |
412 | |
413 void PrerenderHistograms::RecordLocalPredictorTimeUntilUsed( | |
414 base::TimeDelta time_until_used, base::TimeDelta max_age) const { | |
415 PREFIXED_HISTOGRAM( | |
416 "LocalPredictorTimeUntilUsed", | |
417 UMA_HISTOGRAM_CUSTOM_TIMES( | |
418 name, | |
419 time_until_used, | |
420 base::TimeDelta::FromMilliseconds(10), | |
421 max_age, | |
422 50)); | |
423 } | |
424 | |
425 } // namespace prerender | 396 } // namespace prerender |
OLD | NEW |