As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 687081 - Add telemetry for time to find a cache entry
: Add telemetry for time to find a cache entry
Product: Core
Classification: Components
Component: Networking: Cache (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla10
Assigned To: Nicholas Hurley [:nwgh][:hurley]
: Patrick McManus [:mcmanus]
Depends on:
  Show dependency treegraph
Reported: 2011-09-16 09:29 PDT by Nicholas Hurley [:nwgh][:hurley]
Modified: 2011-10-31 11:21 PDT (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

timing patch (12.48 KB, patch)
2011-09-28 10:45 PDT, Nicholas Hurley [:nwgh][:hurley]
jduell.mcbugs: review+
Details | Diff | Splinter Review
updated patch (6.26 KB, patch)
2011-10-28 11:28 PDT, Nicholas Hurley [:nwgh][:hurley]
hurley: review+
Details | Diff | Splinter Review

Description User image Nicholas Hurley [:nwgh][:hurley] 2011-09-16 09:29:01 PDT
Want to know how long we're spending searching the cache in total, as well as how long we're spending on each of memory/disk/offline. Could try to correlate with cache miss somehow, too?
Comment 1 User image Nicholas Hurley [:nwgh][:hurley] 2011-09-28 10:45:46 PDT
Created attachment 563109 [details] [diff] [review]
timing patch

Patch that measures time to lookup cache entries in us (originally did this with telemetry autotimers, but since those are in ms the results weren't very interesting to look at)
Comment 2 User image Jason Duell [:jduell] (needinfo me) 2011-10-24 22:02:58 PDT
Comment on attachment 563109 [details] [diff] [review]
timing patch

Review of attachment 563109 [details] [diff] [review]:

+r so long as you change all the places where you call telemetry code at every return point in the function to instead just use a Telemetry::AutoTimer.   If there are cases where you don't want to record telemetry when returning from an error (seems to be the case in nsCacheService::SearchCacheDevices) then at least replace 

  Telemetry::Accumulate(Telemetry::CACHE_DEVICE_SEARCH, static_cast<PRInt32>(PR_Now() - start));

  with AccumulateTimeDelta(Telemetry::CACHE_DEVICE_SEARCH, start);

I wonder if the memory cache is going to show useful metrics--I'd expect it to always return in <1 ms.   No harm in trying...
Comment 3 User image Nicholas Hurley [:nwgh][:hurley] 2011-10-27 16:57:15 PDT
Comment 4 User image Nicholas Hurley [:nwgh][:hurley] 2011-10-28 11:28:47 PDT
Created attachment 570316 [details] [diff] [review]
updated patch

Updated to use autotimers everywhere. This is the patch that was pushed to try above.
Comment 5 User image Nicholas Hurley [:nwgh][:hurley] 2011-10-28 11:29:11 PDT
Try looks good
Comment 7 User image Matt Brubeck (:mbrubeck) 2011-10-31 11:21:56 PDT

Note You need to log in before you can comment on or make changes to this bug.