summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-29 21:21:06 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-29 21:21:06 +0000
commitcea0201e639979c0e7ca4f3a771f24621dba7ecc (patch)
tree4a13093e04bbf8d4dc6df62309c5e9220c3a919d
parentbab2cdd981b91bc13da24feec9437f7e50579736 (diff)
downloadchromium_src-cea0201e639979c0e7ca4f3a771f24621dba7ecc.zip
chromium_src-cea0201e639979c0e7ca4f3a771f24621dba7ecc.tar.gz
chromium_src-cea0201e639979c0e7ca4f3a771f24621dba7ecc.tar.bz2
Deeper histogram for SQLITE_IOERR.
Sqlite.Error records the basic SQLite error codes. Most of the extended codes are under SQLITE_IOERR, add a new histogram to record those. BUG=none Review URL: https://chromiumcodereview.appspot.com/14439007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197147 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--sql/connection.cc9
-rw-r--r--tools/metrics/histograms/histograms.xml43
2 files changed, 52 insertions, 0 deletions
diff --git a/sql/connection.cc b/sql/connection.cc
index 5f6b590..29708e4 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -714,6 +714,15 @@ int Connection::OnSqliteError(int err, sql::Statement *stmt) {
static size_t kSqliteErrorMax = 50;
UMA_HISTOGRAM_ENUMERATION("Sqlite.Error", base_err, kSqliteErrorMax);
+ if (base_err == SQLITE_IOERR) {
+ // TODO(shess): Consider folding the IOERR range into the main
+ // histogram directly. Perhaps 30..49? The downside risk would
+ // be that SQLite core adds a bunch of codes and this becomes a
+ // complicated mapping.
+ static size_t kSqliteIOErrorMax = 20;
+ UMA_HISTOGRAM_ENUMERATION("Sqlite.Error.IOERR", err>>8, kSqliteIOErrorMax);
+ }
+
if (!error_histogram_name_.empty()) {
// TODO(shess): The histogram macros create a bit of static
// storage for caching the histogram object. Since SQLite is
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index c21f5c9..cd242d1 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -5769,6 +5769,10 @@ other types of suffix sets.
<summary>Error codes returned by sqlite for all databases.</summary>
</histogram>
+<histogram name="Sqlite.Error.IOERR" enum="SqliteIOERRCode">
+ <summary>Error codes returned by sqlite for all databases.</summary>
+</histogram>
+
<histogram name="Sqlite.History.Error" enum="SqliteErrorCode">
<summary>Error codes returned by sqlite for the history db.</summary>
</histogram>
@@ -9306,6 +9310,45 @@ other types of suffix sets.
<int value="1" label="Revisit"/>
</enum>
+<enum name="SqliteIOERRCode" type="int">
+ <summary>Extended error codes returned by SQLite - see sqlite.h</summary>
+ <int value="0" label="SQLITE_IOERR">No extended code given</int>
+ <int value="1" label="SQLITE_IOERR_READ">Error reading from file</int>
+ <int value="2" label="SQLITE_IOERR_SHORT_READ">Short read from file</int>
+ <int value="3" label="SQLITE_IOERR_WRITE">
+ Error writing to file (other than SQLITE_FULL)
+ </int>
+ <int value="4" label="SQLITE_IOERR_FSYNC">Error syncing to disk</int>
+ <int value="5" label="SQLITE_IOERR_DIR_FSYNC">
+ Error syncing directory changes to disk
+ </int>
+ <int value="6" label="SQLITE_IOERR_TRUNCATE">Error truncating file</int>
+ <int value="7" label="SQLITE_IOERR_FSTAT">Error reading file metadata</int>
+ <int value="8" label="SQLITE_IOERR_UNLOCK">Error unlocking file</int>
+ <int value="9" label="SQLITE_IOERR_RDLOCK">
+ Error getting read lock - should not be possible
+ </int>
+ <int value="10" label="SQLITE_IOERR_DELETE">Error deleting file</int>
+ <int value="11" label="SQLITE_IOERR_BLOCKED">
+ Deadlock due to other process access to SQLite files
+ </int>
+ <int value="12" label="SQLITE_IOERR_NOMEM">Error mapping shared memory</int>
+ <int value="13" label="SQLITE_IOERR_ACCESS">
+ Error getting file attributes (other than not found)
+ </int>
+ <int value="14" label="SQLITE_IOERR_CHECKRESERVEDLOCK">
+ Error while querying lock status
+ </int>
+ <int value="15" label="SQLITE_IOERR_LOCK">Error acquiring lock</int>
+ <int value="16" label="SQLITE_IOERR_CLOSE">Error closing file</int>
+ <int value="17" label="SQLITE_IOERR_DIR_CLOSE">Unused</int>
+ <int value="18" label="SQLITE_IOERR_SHMOPEN">Error mmapping file</int>
+ <int value="19" label="SQLITE_IOERR_SHMSIZE">
+ Error in stat while mmapping file
+ </int>
+ <int value="20" label="SQLITE_IOERR_SHMLOCK">Unused</int>
+</enum>
+
<enum name="TcpSocketStatus" type="int">
<int value="0" label="Unknown"/>
<int value="1" label="Fast Connection Return"/>