diff options
author | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 10:49:55 +0000 |
---|---|---|
committer | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 10:49:55 +0000 |
commit | ee242ef591b37d73855d1f8503494a6eac962761 (patch) | |
tree | 9a4ff39e9539540a0f63ad030eed797a65713663 /webkit | |
parent | 88ca9a5c5cd669d85eaf4fd0c2be8a28ee9a730e (diff) | |
download | chromium_src-ee242ef591b37d73855d1f8503494a6eac962761.zip chromium_src-ee242ef591b37d73855d1f8503494a6eac962761.tar.gz chromium_src-ee242ef591b37d73855d1f8503494a6eac962761.tar.bz2 |
Add UMA statistics for tracking session storage database opening failures.
R=michaeln
BUG=NONE
Review URL: https://chromiumcodereview.appspot.com/12316124
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/dom_storage/session_storage_database.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/webkit/dom_storage/session_storage_database.cc b/webkit/dom_storage/session_storage_database.cc index b22ea30..d3613d4 100644 --- a/webkit/dom_storage/session_storage_database.cc +++ b/webkit/dom_storage/session_storage_database.cc @@ -6,6 +6,7 @@ #include "base/file_util.h" #include "base/logging.h" +#include "base/metrics/histogram.h" #include "base/stringprintf.h" #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" @@ -16,6 +17,19 @@ #include "third_party/leveldatabase/src/include/leveldb/options.h" #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" +#define SESSION_STORAGE_UMA_NAME "SessionStorageDatabase.Open" + +namespace { + +enum SessionStorageUMA { + SESSION_STORAGE_UMA_SUCCESS, + SESSION_STORAGE_UMA_RECREATED, + SESSION_STORAGE_UMA_FAIL, + SESSION_STORAGE_UMA_MAX +}; + +} // namespace + // Layout of the database: // | key | value | // ----------------------------------------------------------------------- @@ -286,10 +300,20 @@ bool SessionStorageDatabase::LazyOpen(bool create_if_needed) { if (!s.ok()) { LOG(WARNING) << "Failed to open leveldb in " << file_path_.value() << ", error: " << s.ToString(); + UMA_HISTOGRAM_ENUMERATION(SESSION_STORAGE_UMA_NAME, + SESSION_STORAGE_UMA_FAIL, + SESSION_STORAGE_UMA_MAX); DCHECK(db == NULL); db_error_ = true; return false; } + UMA_HISTOGRAM_ENUMERATION(SESSION_STORAGE_UMA_NAME, + SESSION_STORAGE_UMA_RECREATED, + SESSION_STORAGE_UMA_MAX); + } else { + UMA_HISTOGRAM_ENUMERATION(SESSION_STORAGE_UMA_NAME, + SESSION_STORAGE_UMA_SUCCESS, + SESSION_STORAGE_UMA_MAX); } db_.reset(db); return true; |