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/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 | 402 |
403 void PrerenderHistograms::RecordPrerenderPageVisitedStatus( | 403 void PrerenderHistograms::RecordPrerenderPageVisitedStatus( |
404 Origin origin, | 404 Origin origin, |
405 uint8 experiment_id, | 405 uint8 experiment_id, |
406 bool visited_before) const { | 406 bool visited_before) const { |
407 PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT( | 407 PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT( |
408 "PageVisitedStatus", origin, experiment_id, | 408 "PageVisitedStatus", origin, experiment_id, |
409 UMA_HISTOGRAM_BOOLEAN(name, visited_before)); | 409 UMA_HISTOGRAM_BOOLEAN(name, visited_before)); |
410 } | 410 } |
411 | 411 |
412 void PrerenderHistograms::RecordNetworkBytes(bool used, | |
413 int64 prerender_bytes, | |
414 int64 profile_bytes) { | |
415 if (used) | |
416 UMA_HISTOGRAM_COUNTS("Prerender.NetworkBytes.Used", prerender_bytes); | |
Alexei Svitkine (slow)
2014/02/13 16:28:44
The default UMA_HISTOGRAM_COUNTS() macro defines a
jkarlin
2014/02/13 17:27:52
Done. Thanks!
On 2014/02/13 16:28:44, Alexei Svi
| |
417 else | |
418 UMA_HISTOGRAM_COUNTS("Prerender.NetworkBytes.Wasted", prerender_bytes); | |
419 | |
420 UMA_HISTOGRAM_COUNTS("Prerender.NetworkBytes.TotalForProfile", profile_bytes); | |
421 } | |
422 | |
412 uint8 PrerenderHistograms::GetCurrentExperimentId() const { | 423 uint8 PrerenderHistograms::GetCurrentExperimentId() const { |
413 if (!WithinWindow()) | 424 if (!WithinWindow()) |
414 return kNoExperiment; | 425 return kNoExperiment; |
415 return last_experiment_id_; | 426 return last_experiment_id_; |
416 } | 427 } |
417 | 428 |
418 bool PrerenderHistograms::IsOriginExperimentWash() const { | 429 bool PrerenderHistograms::IsOriginExperimentWash() const { |
419 if (!WithinWindow()) | 430 if (!WithinWindow()) |
420 return false; | 431 return false; |
421 return origin_experiment_wash_; | 432 return origin_experiment_wash_; |
422 } | 433 } |
423 | 434 |
424 } // namespace prerender | 435 } // namespace prerender |
OLD | NEW |