diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 00:32:58 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 00:32:58 +0000 |
commit | 33521502aee91e668255810164fd122b7b47bd89 (patch) | |
tree | bc1b8c0463e8cd553b2ba04de9d2683f012f0cee /chrome/browser/history | |
parent | b7b7678705a07e54f3d630dc809cb00bc4f758be (diff) | |
download | chromium_src-33521502aee91e668255810164fd122b7b47bd89.zip chromium_src-33521502aee91e668255810164fd122b7b47bd89.tar.gz chromium_src-33521502aee91e668255810164fd122b7b47bd89.tar.bz2 |
Metrics for the in-memory DB size to see if we spend too much time loading it,
and how big it ends up being.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/193061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/in_memory_database.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/history/in_memory_database.cc b/chrome/browser/history/in_memory_database.cc index 7b21d86..93da6f7 100644 --- a/chrome/browser/history/in_memory_database.cc +++ b/chrome/browser/history/in_memory_database.cc @@ -4,8 +4,10 @@ #include "chrome/browser/history/in_memory_database.h" +#include "base/histogram.h" #include "base/logging.h" #include "base/string_util.h" +#include "base/time.h" namespace history { @@ -71,12 +73,17 @@ bool InMemoryDatabase::InitFromDisk(const std::wstring& history_name) { } // Copy URL data to memory. + base::TimeTicks begin_load = base::TimeTicks::Now(); if (sqlite3_exec(db_, "INSERT INTO urls SELECT * FROM history.urls WHERE typed_count > 0", NULL, NULL, NULL) != SQLITE_OK) { // Unable to get data from the history database. This is OK, the file may // just not exist yet. } + base::TimeTicks end_load = base::TimeTicks::Now(); + UMA_HISTOGRAM_MEDIUM_TIMES("History.InMemoryDBPopulate", + end_load - begin_load); + UMA_HISTOGRAM_COUNTS("History.InMemoryDBItemCount", sqlite3_changes(db_)); // Detach from the history database on disk. if (sqlite3_exec(db_, "DETACH history", NULL, NULL, NULL) != SQLITE_OK) { |