Skip to content

bug 2049040 - Accept 0-duration samples in timing_distribution metrics#3512

Draft
chutten wants to merge 1 commit into
mainfrom
bug2049040-zeroTimings
Draft

bug 2049040 - Accept 0-duration samples in timing_distribution metrics#3512
chutten wants to merge 1 commit into
mainfrom
bug2049040-zeroTimings

Conversation

@chutten

@chutten chutten commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

They go into the underflow bucket.

This means a sample of 1 becomes 1x (where x is the time_unit), a duration of 1ns is still promoted to 1x (where x is the time_unit), but a sample of 0 or a duration of 0 remains 0 to count in the 0 (underflow) bucket.

(( draft for now because I haven't 1) Added more tests for 0 values for all APIs of all the metrics to make sure our behaviours aren't surprising and don't change out from under us, or 2) thought deeply about the ramifications of reporting counts of zeroes in their special zero buckets. ))

Alternatives not fully considered:

  • Record it as a zero for the purposes of sum, but put it in the bucket for 1x (where x is time_unit) like the rest of the < 1x values

They go into the underflow bucket.

This means a sample of 1 becomes 1x (where x is the time_unit), a duration of
1ns becomes 1x (where x is the time_unit), but a sample of 0 or a
duration of 0 remains 0 to count in the 0 (underflow) bucket.
@chutten

chutten commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Another alternative not considered: treating a sample of 0 as zero, but treating durations of 0 as 1x. Would limit the code changes necessary while also fixing the issue I had in Desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant