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.KB", | |
417 prerender_bytes >> 10); | |
Alexei Svitkine (slow)
2014/02/13 15:50:50
Wouldn't you be losing the remainder bytes each ti
jkarlin
2014/02/13 16:04:14
Done.
| |
418 } else { | |
419 UMA_HISTOGRAM_COUNTS("Prerender.NetworkBytes.Wasted.KB", | |
420 prerender_bytes >> 10); | |
421 } | |
422 UMA_HISTOGRAM_COUNTS("Prerender.NetworkBytes.TotalForProfile.KB", | |
423 profile_bytes >> 10); | |
424 } | |
425 | |
412 uint8 PrerenderHistograms::GetCurrentExperimentId() const { | 426 uint8 PrerenderHistograms::GetCurrentExperimentId() const { |
413 if (!WithinWindow()) | 427 if (!WithinWindow()) |
414 return kNoExperiment; | 428 return kNoExperiment; |
415 return last_experiment_id_; | 429 return last_experiment_id_; |
416 } | 430 } |
417 | 431 |
418 bool PrerenderHistograms::IsOriginExperimentWash() const { | 432 bool PrerenderHistograms::IsOriginExperimentWash() const { |
419 if (!WithinWindow()) | 433 if (!WithinWindow()) |
420 return false; | 434 return false; |
421 return origin_experiment_wash_; | 435 return origin_experiment_wash_; |
422 } | 436 } |
423 | 437 |
424 } // namespace prerender | 438 } // namespace prerender |
OLD | NEW |