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

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: Um, yes, EENGINEERFAILURE 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
Index: sql/connection.h
diff --git a/sql/connection.h b/sql/connection.h
index cebc774fa57a2f80b4600edeae5dddb55e343c98..ffc3d65be287c4787358035fdef2440ad3a2bb71 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 prefix to enable additional connection-type
+ // histogramming for SQLite error codes and database version
+ // numbers.
+ void set_histogram_prefix(const std::string& prefix) {
+ histogram_prefix_ = prefix;
}
+ // Record a sparse UMA histogram sample under |histogram_prefix_|+|suffix|.
+ // If |histogram_prefix_| is empty, no histogram is recorded.
+ void AddSparseHistogram(const std::string& suffix, 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_;
+ // Prefix for auxiliary histograms.
+ std::string histogram_prefix_;
DISALLOW_COPY_AND_ASSIGN(Connection);
};

Powered by Google App Engine
This is Rietveld 408576698