add telemetry for number of setTimeouts during an nsITimer run

RESOLVED FIXED in mozilla12

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

unspecified
mozilla12
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
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

5 years ago
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.
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.
(Assignee)

Comment 3

5 years ago
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.
Attachment #587332 - Flags: review?(bzbarsky)
Comment on attachment 587332 [details] [diff] [review]
patch for timers fired per nsITimer

r=me
Attachment #587332 - Flags: review?(bzbarsky) → review+

Comment 5

5 years ago
Comment on attachment 587332 [details] [diff] [review]
patch for timers fired per nsITimer

Should prefix this histogram as DOM_
(Assignee)

Comment 6

5 years ago
Created attachment 588083 [details] [diff] [review]
patch for timers fired per nsITimer

Adding DOM_ prefix per Taras's suggestion.  Carrying over r+.
Attachment #587332 - Attachment is obsolete: true
Attachment #588083 - Flags: review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/d41fbe450000
Flags: in-testsuite-
Keywords: checkin-needed
Target Milestone: --- → mozilla12
https://hg.mozilla.org/mozilla-central/rev/d41fbe450000
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.