Open Bug 1365526 Opened 8 years ago Updated 2 years ago

Refactor TelemetryHistogram::Accumulate* functions to share the logic

Categories

(Toolkit :: Telemetry, enhancement, P3)

enhancement
Points:
1

Tracking

()

People

(Reporter: Dexter, Unassigned)

References

Details

(Whiteboard: [measurement:client])

(In reply to Georg Fritzsche [:gfritzsche] from bug 1343855 comment #22) > @@ +2032,5 @@ > > } > > > > + // Check if we're allowed to record in the provided key, for this histogram. > > + if (!gHistograms[aID].allows_key(aKey.get())) { > > + LogToBrowserConsole(nsIScriptError::errorFlag, > > Both this and the function below end up calling `internal_Accumulate()` and > the logic is duplicated. > But i see that this ends up requiring passing status codes around. > > We should really refactor the status/warning/error flow here, but that can > happen around bug 1278821 (as a follow-up or blocker). > Can you file something? > > [...] > > Right, i see. The key check should probably still live inside `internal_Accumulate()`. > If we do this now though, then you can't log errors directly. > So you would need to pass status codes out to print them from the non-locked part, similar to how the scalars do 3-phase JS function implementation. > This sounds like a follow-up after bug 1278821. The function Georg is talking about are here: http://searchfox.org/mozilla-central/rev/9a7fbdee1d54f99cd548af95b81231d80e5f9ad1/toolkit/components/telemetry/TelemetryHistogram.cpp#1976,1989
Points: --- → 1
Depends on: 1278821
Priority: -- → P3
Whiteboard: [measurement:client]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.