Closed Bug 782459 Opened 8 years ago Closed 8 years ago

Generalize the telemetry AutoTimer RAII class to provide multiple resolution.

Categories

(Toolkit :: Telemetry, defect)

Other
Other
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: padenot, Assigned: padenot)

References

Details

Attachments

(1 file, 3 obsolete files)

We need to be able to choose the resolution needed when using AutoTimer for telemetry. For now, it uses milliseconds, which is not sufficient for some data we need to gather, that need microseconds resolution.
This patches uses templates to statically choose which resolution we want, at
compile time. By default, it uses milliseconds resolution, to avoid breaking
existing code.
Attachment #651822 - Flags: review?(taras.mozilla)
Now with the right patch.
Attachment #651823 - Flags: review?(taras.mozilla)
Attachment #651822 - Attachment is obsolete: true
Attachment #651822 - Flags: review?(taras.mozilla)
Comment on attachment 651823 [details] [diff] [review]
Generalize the telemetry AutoTimer RAII class to provide multiple resolution. r=

That's pretty sweet, thanks
Attachment #651823 - Flags: review?(taras.mozilla) → review+
Keywords: checkin-needed
Keywords: checkin-needed
This is busted on Windows, because our old compiler don't like default template argument for free functions:

    e:\builds\moz2_slave\try-w32\build\obj-firefox\dist\include\mozilla/Telemetry.h(61) : error C4519: default template arguments are only allowed on a class template

I'll come up with a fix when I get a chance, probably a trick using overloading, but it would be uglier.
Comment on attachment 652602 [details] [diff] [review]
Generalize the telemetry AutoTimer RAII class to provide multiple resolution. r=

Less nice, but compiles everywhere.
Attachment #652602 - Flags: review?(taras.mozilla)
Attachment #651823 - Attachment is obsolete: true
Comment on attachment 652602 [details] [diff] [review]
Generalize the telemetry AutoTimer RAII class to provide multiple resolution. r=

yuck
Attachment #652602 - Flags: review?(taras.mozilla) → review+
Attachment #652602 - Attachment is obsolete: true
Attachment #655499 - Flags: review+
Keywords: checkin-needed
Blocks: 761393
https://hg.mozilla.org/mozilla-central/rev/6a8b865e6225
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.