Generalize the telemetry AutoTimer RAII class to provide multiple resolution.

RESOLVED FIXED in mozilla18

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: padenot, Assigned: padenot)

Tracking

unspecified
mozilla18
Other
Other
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

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: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.