Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: chrome/browser/prerender/prerender_histograms.cc

Issue 10802024: Make three simultanious prerenders the default maximum in Canary and Dev only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix field trial Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
11 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
12 #include "chrome/browser/predictors/autocomplete_action_predictor.h" 13 #include "chrome/browser/predictors/autocomplete_action_predictor.h"
13 #include "chrome/browser/prerender/prerender_field_trial.h" 14 #include "chrome/browser/prerender/prerender_field_trial.h"
14 #include "chrome/browser/prerender/prerender_manager.h" 15 #include "chrome/browser/prerender/prerender_manager.h"
15 #include "chrome/browser/prerender/prerender_util.h" 16 #include "chrome/browser/prerender/prerender_util.h"
16 17
17 using predictors::AutocompleteActionPredictor; 18 using predictors::AutocompleteActionPredictor;
18 19
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 150 }
150 151
151 void PrerenderHistograms::RecordPrerenderStarted(Origin origin) const { 152 void PrerenderHistograms::RecordPrerenderStarted(Origin origin) const {
152 if (OriginIsOmnibox(origin)) { 153 if (OriginIsOmnibox(origin)) {
153 UMA_HISTOGRAM_ENUMERATION( 154 UMA_HISTOGRAM_ENUMERATION(
154 StringPrintf("Prerender.OmniboxPrerenderCount%s", 155 StringPrintf("Prerender.OmniboxPrerenderCount%s",
155 PrerenderManager::GetModeString()), 1, 2); 156 PrerenderManager::GetModeString()), 1, 2);
156 } 157 }
157 } 158 }
158 159
160 void PrerenderHistograms::RecordConcurrency(size_t prerender_count) const {
161 static const size_t kMaxRecordableConcurrency = 3;
162 const size_t max_concurrency = PrerenderManager::GetMaxConcurrency();
163 DCHECK_GE(kMaxRecordableConcurrency, max_concurrency);
164 if (max_concurrency > 1) {
165 UMA_HISTOGRAM_ENUMERATION(
166 StringPrintf("Prerender.PrerenderCountOf%" PRIuS "Max",
167 max_concurrency),
168 prerender_count, kMaxRecordableConcurrency + 1);
169 }
170 }
171
159 void PrerenderHistograms::RecordUsedPrerender(Origin origin) const { 172 void PrerenderHistograms::RecordUsedPrerender(Origin origin) const {
160 if (OriginIsOmnibox(origin)) { 173 if (OriginIsOmnibox(origin)) {
161 UMA_HISTOGRAM_ENUMERATION( 174 UMA_HISTOGRAM_ENUMERATION(
162 StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s", 175 StringPrintf("Prerender.OmniboxNavigationsUsedPrerenderCount%s",
163 PrerenderManager::GetModeString()), 1, 2); 176 PrerenderManager::GetModeString()), 1, 2);
164 } 177 }
165 } 178 }
166 179
167 void PrerenderHistograms::RecordTimeSinceLastRecentVisit( 180 void PrerenderHistograms::RecordTimeSinceLastRecentVisit(
168 base::TimeDelta delta) const { 181 base::TimeDelta delta) const {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 "LocalPredictorTimeUntilUsed", 415 "LocalPredictorTimeUntilUsed",
403 UMA_HISTOGRAM_CUSTOM_TIMES( 416 UMA_HISTOGRAM_CUSTOM_TIMES(
404 name, 417 name,
405 time_until_used, 418 time_until_used,
406 base::TimeDelta::FromMilliseconds(10), 419 base::TimeDelta::FromMilliseconds(10),
407 max_age, 420 max_age,
408 50)); 421 50));
409 } 422 }
410 423
411 } // namespace prerender 424 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_histograms.h ('k') | chrome/browser/prerender/prerender_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698