Skip to content

fix(tick durations): handle an empty sample of tick times - #319

Open
MarvinKlar wants to merge 1 commit into
sladkoff:masterfrom
Ottonien:fix/empty-tick-duration-samples
Open

MarvinKlar wants to merge 1 commit into
sladkoff:masterfrom
Ottonien:fix/empty-tick-duration-samples

Conversation

@MarvinKlar

Copy link
Copy Markdown
Contributor

A server that has not ticked yet reports an empty sample. The collectors indexed into that array right away, so a scrape during startup failed with an ArrayIndexOutOfBoundsException (median) and an ArithmeticException (average), while min and max silently reported Long.MAX_VALUE and Long.MIN_VALUE.

All four collectors now report NaN until the server has ticked.

A server that has not ticked yet reports an empty sample. The collectors indexed into that array
right away, so a scrape during startup failed with an ArrayIndexOutOfBoundsException (median) and
an ArithmeticException (average), while min and max silently reported Long.MAX_VALUE and
Long.MIN_VALUE.

All four collectors now report NaN until the server has ticked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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