RESOLVED FIXED 98465
IndexedDB: Add histogram statistics for backing store errors
https://bugs.webkit.org/show_bug.cgi?id=98465
Summary IndexedDB: Add histogram statistics for backing store errors
Joshua Bell
Reported 2012-10-04 16:46:52 PDT
IndexedDB: Add histogram statistics for backing store errors
Attachments
Patch (20.78 KB, patch)
2012-10-04 16:49 PDT, Joshua Bell
no flags
Patch (26.49 KB, patch)
2012-10-08 09:54 PDT, Joshua Bell
no flags
Patch (31.17 KB, patch)
2012-10-25 13:45 PDT, Joshua Bell
no flags
Patch (30.74 KB, patch)
2012-10-25 15:55 PDT, Joshua Bell
no flags
Joshua Bell
Comment 1 2012-10-04 16:49:33 PDT
Joshua Bell
Comment 2 2012-10-04 16:51:06 PDT
We may want to sprinkle InternalError() over other failure sites.
Joshua Bell
Comment 3 2012-10-05 10:26:06 PDT
Other possible TODOs (before or after landing): * Give InternalError() a message param which is logged/asserted/appended to histogram name * Distinguish I/O errors (get/put failed, etc) from data consistency errors (decode failed)
Joshua Bell
Comment 4 2012-10-08 09:54:08 PDT
Joshua Bell
Comment 5 2012-10-08 09:59:09 PDT
Sprinkled in a few more InternalError() macro calls. I experimented with instrumenting the duration of open() and deleteDatabase() calls in the backing store, which led to me track down http://code.google.com/p/leveldb/issues/detail?id=125 .. because it wasn't showing up as a slowdown with either open or deleteDatabase in the backing store. So I did not include those in the patch, but adding them is easy: double startTime = monotonicallyIncreasingTime(); ... double durationMS = (monotonicallyIncreasingTime() - startTime) * 1000.0; HistogramSupport::histogramCustomCounts("WebCore.IndexedDB.BackingStore.OpenDuration", static_cast<int>(durationMS), 0, 2000, 20); The question is just when to measure. The backing store time may not be as interesting as measuring the time from the script call to "success". Or should that be "upgradeneeded"? Front end or back end? And is that enqueue or dispatch? And what if "blocked" fires? Needs further discussion.
David Grogan
Comment 6 2012-10-08 13:29:31 PDT
Comment on attachment 167551 [details] Patch LGTM as is if we don't get any suggestions. Do you know how to look at this data? I don't.
Joshua Bell
Comment 7 2012-10-15 14:21:23 PDT
abarth@ - could you take a look at this and see if this follows our general strategy for histograms in WebCore, and also the style of the "InternalError" macro?
Adam Barth
Comment 8 2012-10-16 11:14:13 PDT
Comment on attachment 167551 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=167551&action=review > Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp:64 > +#define InternalError() \ > + do { \ > + ASSERT_NOT_REACHED(); \ > + LOG_ERROR("Internal IndexedDB Error"); \ > + HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingStore.InternalError", LevelDBBackingStoreInternalError, LevelDBBackingStoreInternalErrorMax); \ > + } while (0) Why a macro and not an inline function?
Adam Barth
Comment 9 2012-10-16 11:14:59 PDT
(In reply to comment #7) > abarth@ - could you take a look at this and see if this follows our general strategy for histograms in WebCore, and also the style of the "InternalError" macro? That all seems fine. As I mentioned above, I'm not sure why you've used a macro here rather than an inline function. Perhaps LOG_ERROR works better that way?
Joshua Bell
Comment 10 2012-10-16 11:52:22 PDT
(In reply to comment #9) As I mentioned above, I'm not sure why you've used a macro here rather than an inline function. Perhaps LOG_ERROR works better that way? Exactly - the ASSERT_NOT_REACHED() and LOG_ERROR() are both more useful when they have the original source line. One thing that I can do which will IMHO make the code more readable is to move the HistogramSupport::histogramEnumeration(...) call itself into an inline function referenced by the macro, so the macro has less "payload".
Joshua Bell
Comment 11 2012-10-25 13:45:58 PDT
Joshua Bell
Comment 12 2012-10-25 13:56:10 PDT
(In reply to comment #11) > Created an attachment (id=170725) [details] > Patch Waiting on an internal review of the histograms metadata file. abarth@ - r?
Adam Barth
Comment 13 2012-10-25 15:23:31 PDT
Comment on attachment 170725 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=170725&action=review > Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp:484 > - return transaction->commit(); > + if (!transaction->commit()) { > + } > + return true; This looks a bit strange. Is there a typo here?
Joshua Bell
Comment 14 2012-10-25 15:55:01 PDT
Joshua Bell
Comment 15 2012-10-25 16:45:57 PDT
(In reply to comment #13) > This looks a bit strange. Is there a typo here? Yes, half-aborted change. Fixed.
WebKit Review Bot
Comment 16 2012-10-25 21:06:03 PDT
Comment on attachment 170755 [details] Patch Clearing flags on attachment: 170755 Committed r132568: <http://trac.webkit.org/changeset/132568>
WebKit Review Bot
Comment 17 2012-10-25 21:06:08 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.