Closed
Bug 1560049
Opened 6 years ago
Closed 6 years ago
Timespan and TimingDistributions are fundamentally bugged: hashCode is not stable outside of obj lifetime
Categories
(Data Platform and Tools :: Glean: SDK, defect, P1)
Data Platform and Tools
Glean: SDK
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: Dexter, Assigned: Dexter)
References
Details
(Whiteboard: [telemetry:mobilesdk:m7])
Attachments
(1 file)
Timespans and TiminigDistirbution are accepting an (id: Any) object to distinguish between running time measurements. However, this relies on hashCode to be stable after the lifetime of 'id', which is not guaranteed.
Luckily for us, no one is using TimingDistribution and Timespans for now (except Glean SDK internals with the 'baseline.duration' metric), so we could fix this with no repercussions in the wild.
The proposed solution:
- have the 'timer.start()' method of both Timespan and TimingDistribution return an handler/integer;
- have the caller manage that timer id and pass it to the 'stopAndSum' when required.
The id would just be a synchronized incremental integer, incremented on every start() call, on the TimingManager.
| Assignee | ||
Updated•6 years ago
|
Priority: -- → P1
Whiteboard: [telemetry:mobilesdk:m7]
| Assignee | ||
Updated•6 years ago
|
Assignee: nobody → alessio.placitelli
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 3•6 years ago
|
||
For the future: some of our notes for the reworked API are here - https://docs.google.com/document/d/1x5Vm21K805eN9xyXHt5zvVkR9m-usOyGWQFJoumLE5w/edit
You need to log in
before you can comment on or make changes to this bug.
Description
•