Open Bug 1639581 Opened 6 years ago Updated 5 years ago

In typesafe language bindings with lightweight types consider typing the TimerID to the metric that started it

Categories

(Data Platform and Tools :: Glean: SDK, defect, P4)

defect

Tracking

(Not tracked)

People

(Reporter: chutten, Unassigned)

Details

(Whiteboard: [telemetry:glean-rs:backlog])

In languages that support it, perhaps we should strongly type our timer ids to the timer-based metric that started them. That way no one can accidentally feed a TimerID from one Timing Distribution into the StopAndAccumulate method of another.

For example, js.gc_ms's start() could return a JSGCMSTimerID or TimerID<js::gc_ms> or js::gc_ms::TimerID or something. And then stop_and_accumulate would take only timer ids of that type.

This only works if the types are sufficiently lightweight of course.

Priority: -- → P3
Whiteboard: [telemetry:glean-rs:m?]
Whiteboard: [telemetry:glean-rs:m?] → [telemetry:glean-rs:backlog]
Priority: P3 → P4
You need to log in before you can comment on or make changes to this bug.