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

Unified Diff: webkit/dom_storage/session_storage_database.cc

Issue 12316124: Add UMA statistics for tracking session storage database opening failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/session_storage_database.cc
diff --git a/webkit/dom_storage/session_storage_database.cc b/webkit/dom_storage/session_storage_database.cc
index b22ea30296bd01e45593eb5e10f440c027ead4f8..ba4c021768504d170f6e12ab83edbe930762cded 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,17 @@
#include "third_party/leveldatabase/src/include/leveldb/options.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"
+namespace {
+
michaeln 2013/02/27 00:31:57 Can you define a constant for histogram name value
marja 2013/02/27 08:48:25 Done. I just #define'd it, because we cannot have
michaeln 2013/02/27 20:31:48 I would expect compilers to optimize the multiple
+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 +298,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("SessionStorageDatabase.Open",
+ SESSION_STORAGE_UMA_FAIL,
+ SESSION_STORAGE_UMA_MAX);
DCHECK(db == NULL);
db_error_ = true;
return false;
}
+ UMA_HISTOGRAM_ENUMERATION("SessionStorageDatabase.Open",
+ SESSION_STORAGE_UMA_RECREATED,
+ SESSION_STORAGE_UMA_MAX);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("SessionStorageDatabase.Open",
+ SESSION_STORAGE_UMA_SUCCESS,
+ SESSION_STORAGE_UMA_MAX);
}
db_.reset(db);
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698