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

Unified Diff: sql/connection.h

Issue 14976003: Histogram versions and extended error codes for SQLite databases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops - need old histograms for continuity. Created 7 years, 7 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 | « content/browser/net/sqlite_persistent_cookie_store.cc ('k') | sql/connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.h
diff --git a/sql/connection.h b/sql/connection.h
index cebc774fa57a2f80b4600edeae5dddb55e343c98..44b97f6d1bd959497dfe8977e603e3f4dd0fbac4 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -146,13 +146,17 @@ class SQL_EXPORT Connection {
error_delegate_.reset(delegate);
}
- // SQLite error codes for errors on all connections are logged to
- // enum histogram "Sqlite.Error". Setting this additionally logs
- // errors to the histogram |name|.
- void set_error_histogram_name(const std::string& name) {
- error_histogram_name_ = name;
+ // Set this tag to enable additional connection-type histogramming
+ // for SQLite error codes and database version numbers.
+ void set_histogram_tag(const std::string& tag) {
+ histogram_tag_ = tag;
}
+ // Record a sparse UMA histogram sample under
+ // |name|+"."+|histogram_tag_|. If |histogram_tag_| is empty, no
+ // histogram is recorded.
+ void AddTaggedHistogram(const std::string& name, size_t sample) const;
+
// Initialization ------------------------------------------------------------
// Initializes the SQL connection for the given file, returning true if the
@@ -497,8 +501,8 @@ class SQL_EXPORT Connection {
// commands or statements. It can be null which means default handling.
scoped_ptr<ErrorDelegate> error_delegate_;
- // Auxiliary error-code histogram.
- std::string error_histogram_name_;
+ // Tag for auxiliary histograms.
+ std::string histogram_tag_;
DISALLOW_COPY_AND_ASSIGN(Connection);
};
« no previous file with comments | « content/browser/net/sqlite_persistent_cookie_store.cc ('k') | sql/connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698