Last Comment Bug 715947 - add telemetry for number of setTimeouts during an nsITimer run
: add telemetry for number of setTimeouts during an nsITimer run
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla12
Assigned To: Nathan Froyd [:froydnj]
:
:
Mentors:
Depends on:
Blocks: 715380
  Show dependency treegraph
 
Reported: 2012-01-06 10:15 PST by Nathan Froyd [:froydnj]
Modified: 2012-01-13 03:02 PST (History)
4 users (show)
bzbarsky: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch for timers fired per nsITimer (1.73 KB, patch)
2012-01-10 08:45 PST, Nathan Froyd [:froydnj]
bzbarsky: review+
Details | Diff | Splinter Review
patch for timers fired per nsITimer (1.74 KB, patch)
2012-01-12 09:56 PST, Nathan Froyd [:froydnj]
nfroyd: review+
Details | Diff | Splinter Review

Description Nathan Froyd [:froydnj] 2012-01-06 10:15:51 PST
Splitting this off from bug 715380.

Also, I'm not entirely sure what the desired effect is here.  For something like:

setTimeout(...)  // assume each one is long enough to overlap subsequent ones
setTimeout(...)
setTimeout(...)
setTimeout(...)

What information do you want collected from that?  The number of pending timeouts when we schedule a new one?
Comment 1 (dormant account) 2012-01-06 15:01:03 PST
I know very little of this, so bz or khuey will have to help clarify. For every nsITimer execution that contains setTimeout handlers, we should record the number of those into a histogram.
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-01-06 15:42:39 PST
If I understand the code correctly, nsGlobalWindow::RunTimeout is called once per XPCOM timeout firing.  It may dispatch multiple nsTimeouts (though it's called with a single nsTimeout.  The loops in that function will be of interest to you.
Comment 3 Nathan Froyd [:froydnj] 2012-01-10 08:45:46 PST
Created attachment 587332 [details] [diff] [review]
patch for timers fired per nsITimer

OK, so that wasn't so hard.

Do note that this patch uses Telemetry::AutoCounter from bug 716657; I'll make sure they go in in the proper order.
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2012-01-10 10:31:02 PST
Comment on attachment 587332 [details] [diff] [review]
patch for timers fired per nsITimer

r=me
Comment 5 (dormant account) 2012-01-10 12:09:18 PST
Comment on attachment 587332 [details] [diff] [review]
patch for timers fired per nsITimer

Should prefix this histogram as DOM_
Comment 6 Nathan Froyd [:froydnj] 2012-01-12 09:56:21 PST
Created attachment 588083 [details] [diff] [review]
patch for timers fired per nsITimer

Adding DOM_ prefix per Taras's suggestion.  Carrying over r+.
Comment 7 Boris Zbarsky [:bz] (still a bit busy) 2012-01-12 14:02:15 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/d41fbe450000
Comment 8 :Ms2ger (⌚ UTC+1/+2) 2012-01-13 03:02:13 PST
https://hg.mozilla.org/mozilla-central/rev/d41fbe450000

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