summaryrefslogtreecommitdiffstats
path: root/sql/connection.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-15 09:10:39 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-15 09:10:39 +0000
commit210ce0afe2a62a3d902b30bec98e31606e12132c (patch)
tree94d576b989e5ecd784ce19676bfca0aef3959399 /sql/connection.h
parent0b0032accd7d6b8034bfb7380b4c524ab286c412 (diff)
downloadchromium_src-210ce0afe2a62a3d902b30bec98e31606e12132c.zip
chromium_src-210ce0afe2a62a3d902b30bec98e31606e12132c.tar.gz
chromium_src-210ce0afe2a62a3d902b30bec98e31606e12132c.tar.bz2
Histogram versions and extended error codes for SQLite databases.
Track database versions across the fleet for purposes of making decisions about whether old migration code can be removed. As part of this, refactor histogram code to key off a per-database tag rather than histogram name, and to log in a form which can be fanned out via the field trial logic in histograms.xml [FYI michaeln from webkit/OWNERS, erikwright from {chrome,content}/net/OWNERS, sky for chrome/browser/history/OWNERS] BUG=none TBR=michaeln@chromium.org, erikwright@chromium.org, sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/14976003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200216 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.h')
-rw-r--r--sql/connection.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/connection.h b/sql/connection.h
index cebc774..44b97f6 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);
};