diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-28 23:58:57 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-28 23:58:57 +0000 |
commit | 1fdcb685a3dc07c8f352176a60ab14750329d08d (patch) | |
tree | 0fa8d0f8252d128fca87e006f6a9f310fa5957c8 /chrome/browser/net/sqlite_server_bound_cert_store.cc | |
parent | fcd63909fc5537ce8ac778bf2ffa47f45f7b9329 (diff) | |
download | chromium_src-1fdcb685a3dc07c8f352176a60ab14750329d08d.zip chromium_src-1fdcb685a3dc07c8f352176a60ab14750329d08d.tar.gz chromium_src-1fdcb685a3dc07c8f352176a60ab14750329d08d.tar.bz2 |
Add histograms for SQLiteServerBoundCertStore loading.
BUG=89665
Review URL: https://chromiumcodereview.appspot.com/11640057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/sqlite_server_bound_cert_store.cc')
-rw-r--r-- | chrome/browser/net/sqlite_server_bound_cert_store.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/net/sqlite_server_bound_cert_store.cc b/chrome/browser/net/sqlite_server_bound_cert_store.cc index 75f9318..fb6ab57 100644 --- a/chrome/browser/net/sqlite_server_bound_cert_store.cc +++ b/chrome/browser/net/sqlite_server_bound_cert_store.cc @@ -13,6 +13,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" +#include "base/metrics/histogram.h" #include "base/string_util.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" @@ -164,12 +165,18 @@ bool SQLiteServerBoundCertStore::Backend::Load( // moved to the DB thread as part of http://crbug.com/89665. base::ThreadRestrictions::ScopedAllowIO allow_io; + base::TimeTicks start = base::TimeTicks::Now(); + // Ensure the parent directory for storing certs is created before reading // from it. const FilePath dir = path_.DirName(); if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) return false; + int64 db_size = 0; + if (file_util::GetFileSize(path_, &db_size)) + UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024 ); + db_.reset(new sql::Connection); if (!db_->Open(path_)) { NOTREACHED() << "Unable to open cert DB."; @@ -210,6 +217,12 @@ bool SQLiteServerBoundCertStore::Backend::Load( certs->push_back(cert.release()); } + UMA_HISTOGRAM_COUNTS_10000("DomainBoundCerts.DBLoadedCount", certs->size()); + UMA_HISTOGRAM_CUSTOM_TIMES("DomainBoundCerts.DBLoadTime", + base::TimeTicks::Now() - start, + base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(1), + 50); return true; } |