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

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: excess include. 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..0448f55b9bd8c3ba98c8df4ccf066448764b0409 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -146,13 +146,19 @@ 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 linear UMA histogram sample under
+ // |histogram_prefix_|+|suffix|. If |histogram_prefix_| is empty,
+ // no histogram is recorded.
+ void AddLinearHistogram(const std::string& suffix,
+ size_t sample, size_t sample_max) const;
jar (doing other things) 2013/05/07 23:46:41 nit: one arg per line when wrapping declarations a
Scott Hess - ex-Googler 2013/05/08 19:56:18 Done.
+
// Initialization ------------------------------------------------------------
// Initializes the SQL connection for the given file, returning true if the
@@ -497,8 +503,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