TimespanMetricType: Allow setting raw values in milliseconds
Categories
(Data Platform and Tools :: Glean: SDK, defect, P4)
Tracking
(Not tracked)
People
(Reporter: sebastian, Unassigned)
References
Details
I was adding a TimespanMetricType and needed to use the raw API to set the value manually. Unfortunately there's only setRawNanos, which required me to do the conversion myself.
Extension methods for other dimensions, or using TimeUnit, or using Duration [still experimental] would have been nice. :)
| Reporter | ||
Comment 1•4 years ago
|
||
To add to this: In my case I got confused since I used time_unit: millisecond, needed to provide the value in nanoseconds, but then in the test testGetValue() returned milliseconds again.
Comment 2•4 years ago
|
||
setRawNanos was an API added for specific use cases inside Fenix.
I agree that it's not the most ergonomic.
I have a hesitation against adding more setRaw* methods. Having a setRaw should have at a minimum a way to give the unit, as you proposed using TimeUnit maybe.
We have to put that on the backlog for now though.
Description
•