Chromium Code Reviews| 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" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 | 161 |
| 162 void PrerenderHistograms::RecordPrerenderStarted(Origin origin) const { | 162 void PrerenderHistograms::RecordPrerenderStarted(Origin origin) const { |
| 163 if (OriginIsOmnibox(origin)) { | 163 if (OriginIsOmnibox(origin)) { |
| 164 UMA_HISTOGRAM_ENUMERATION( | 164 UMA_HISTOGRAM_ENUMERATION( |
| 165 StringPrintf("Prerender.OmniboxPrerenderCount%s", | 165 StringPrintf("Prerender.OmniboxPrerenderCount%s", |
| 166 PrerenderManager::GetModeString()), 1, 2); | 166 PrerenderManager::GetModeString()), 1, 2); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 void PrerenderHistograms::RecordConcurrency(size_t prerender_count, | 170 void PrerenderHistograms::RecordConcurrency(size_t prerender_count, |
| 171 size_t max_concurrency) const { | 171 size_t max_concurrency) const { |
|
mmenke
2012/12/18 17:15:15
Since there is no longer a real "max_concurrency",
gavinp
2012/12/18 20:15:12
But max_link_concurrency is also used in here as
| |
| 172 static const size_t kMaxRecordableConcurrency = 3; | 172 static const size_t kMaxRecordableConcurrency = 20; |
| 173 DCHECK_GE(kMaxRecordableConcurrency, max_concurrency); | 173 DCHECK_GE(kMaxRecordableConcurrency, max_concurrency); |
| 174 if (max_concurrency > 1) { | 174 if (max_concurrency > 1) { |
| 175 UMA_HISTOGRAM_ENUMERATION( | 175 UMA_HISTOGRAM_ENUMERATION( |
| 176 StringPrintf("Prerender.PrerenderCountOf%" PRIuS "Max", | 176 StringPrintf("Prerender.PrerenderCountOf%" PRIuS "Max", |
| 177 max_concurrency), | 177 kMaxRecordableConcurrency), |
| 178 prerender_count, kMaxRecordableConcurrency + 1); | 178 prerender_count, kMaxRecordableConcurrency + 1); |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 void PrerenderHistograms::RecordUsedPrerender(Origin origin) const { | 182 void PrerenderHistograms::RecordUsedPrerender(Origin origin) const { |
| 183 if (OriginIsOmnibox(origin)) { | 183 if (OriginIsOmnibox(origin)) { |
| 184 UMA_HISTOGRAM_ENUMERATION( | 184 UMA_HISTOGRAM_ENUMERATION( |
| 185 StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", | 185 StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", |
| 186 PrerenderManager::GetModeString()), 1, 2); | 186 PrerenderManager::GetModeString()), 1, 2); |
| 187 } | 187 } |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 return last_experiment_id_; | 390 return last_experiment_id_; |
| 391 } | 391 } |
| 392 | 392 |
| 393 bool PrerenderHistograms::IsOriginExperimentWash() const { | 393 bool PrerenderHistograms::IsOriginExperimentWash() const { |
| 394 if (!WithinWindow()) | 394 if (!WithinWindow()) |
| 395 return false; | 395 return false; |
| 396 return origin_experiment_wash_; | 396 return origin_experiment_wash_; |
| 397 } | 397 } |
| 398 | 398 |
| 399 } // namespace prerender | 399 } // namespace prerender |
| OLD | NEW |