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

Side by Side Diff: chrome/browser/predictors/autocomplete_action_predictor_table.cc

Issue 10900037: Adding more histograms to ResourcePrefetchPredictor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Changes based on renaming recommendations. Created 8 years, 3 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
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/predictors/autocomplete_action_predictor_table.h" 5 #include "chrome/browser/predictors/autocomplete_action_predictor_table.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 "CREATE TABLE %s ( " 236 "CREATE TABLE %s ( "
237 "id TEXT PRIMARY KEY, " 237 "id TEXT PRIMARY KEY, "
238 "user_text TEXT, " 238 "user_text TEXT, "
239 "url TEXT, " 239 "url TEXT, "
240 "number_of_hits INTEGER, " 240 "number_of_hits INTEGER, "
241 "number_of_misses INTEGER)", kAutocompletePredictorTableName).c_str()); 241 "number_of_misses INTEGER)", kAutocompletePredictorTableName).c_str());
242 if (!success) 242 if (!success)
243 ResetDB(); 243 ResetDB();
244 } 244 }
245 245
246 void AutocompleteActionPredictorTable::LogDatabaseStats() { 246 void AutocompleteActionPredictorTable::LogDatabaseStats(Profile* profile) {
247 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB)); 247 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB));
248 if (CantAccessDatabase()) 248 if (CantAccessDatabase())
249 return; 249 return;
250 250
251 sql::Statement count_statement(DB()->GetUniqueStatement( 251 sql::Statement count_statement(DB()->GetUniqueStatement(
252 base::StringPrintf("SELECT count(id) FROM %s", 252 base::StringPrintf("SELECT count(id) FROM %s",
253 kAutocompletePredictorTableName).c_str())); 253 kAutocompletePredictorTableName).c_str()));
254 if (!count_statement.is_valid() || !count_statement.Step()) 254 if (!count_statement.is_valid() || !count_statement.Step())
255 return; 255 return;
256 UMA_HISTOGRAM_COUNTS("AutocompleteActionPredictor.DatabaseRowCount", 256 UMA_HISTOGRAM_COUNTS("AutocompleteActionPredictor.DatabaseRowCount",
257 count_statement.ColumnInt(0)); 257 count_statement.ColumnInt(0));
258 } 258 }
259 259
260 } // namespace predictors 260 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698