Closed Bug 748914 Opened 14 years ago Closed 14 years ago

implement Telemetry.clearHistogram

Categories

(Toolkit :: Telemetry, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: froydnj, Assigned: froydnj)

References

Details

Attachments

(2 files, 1 obsolete file)

This function would be useful for testing purposes (e.g. about:memory) and for short-lived telemetry about telemetry.
Actually I think this should be done on the histogram js object. Code look like nsITelemetry.getHistogramById("foo").clear() ie "clear" would live next to the snapshot() function in http://mxr.mozilla.org/mozilla-central/source//toolkit/components/telemetry/Telemetry.cpp#478
(In reply to Taras Glek (:taras) from comment #1) > Actually I think this should be done on the histogram js object. I guess it doesn't matter whether the histogram gets removed (Telemetry.clearHistogram) or whether we do the above once bug 748907 is implemented.
Attachment #622092 - Flags: review?(taras.mozilla)
Opted for the JS-centric way of doing it, seemed marginally better.
Attachment #622094 - Flags: review?(taras.mozilla)
Comment on attachment 622092 [details] [diff] [review] part 1 - implement Histogram::Clear General idea seems good. seems like range_checksum_ should be touched. Also should consider using a c++ copy constructor to wipe the sampleset instead of implementing it explicitly(and possibly missing stuff)
Attachment #622092 - Flags: review?(taras.mozilla)
Attachment #622094 - Flags: review?(taras.mozilla) → review+
We already use the default operator= for SnapshotSample; just reuse it after resizing the cleared source appropriately.
Attachment #622092 - Attachment is obsolete: true
Attachment #622136 - Flags: review?(taras.mozilla)
Attachment #622136 - Flags: review?(taras.mozilla) → review+
Assignee: nobody → nfroyd
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla15
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: