Skip to content

fix number formatting#94

Merged
copperlight merged 1 commit intoNetflix:mainfrom
copperlight:number-formatting
Dec 21, 2022
Merged

fix number formatting#94
copperlight merged 1 commit intoNetflix:mainfrom
copperlight:number-formatting

Conversation

@copperlight
Copy link
Copy Markdown
Collaborator

@copperlight copperlight commented Dec 21, 2022

When setting AgeGauges to epoch seconds, such as 1671644992, the resulting protocol line was A:gauge:1.67164e+09, when it is expected to be A:gauge:1671644992. The original AgeGauge tests were not setting large enough numbers to discover this formatting issue.

Swapping StrCat for StrFormat and stripping trailing zeroes and decimal places from the resulting number strings produces the output we want. The AgeGauge tests have been updated to use more representative numbers.

This change also locks Bazel at version 5.4.0, since there are a number of breaking changes in the 6.0.0 release.

Comment thread spectator/stateless_meters.h Outdated
When setting AgeGauges to epoch seconds, such as `1671644992`, the
resulting protocol line was `A:gauge:1.67164e+09`, when it is expected
to be `A:gauge:1671644992`. The original AgeGauge tests were not setting
large enough numbers to discover this formatting issue.

Swapping `StrCat` for `StrFormat` and stripping trailing zeroes and decimal
places from the resulting number strings produces the output we want. The
AgeGauge tests have been updated to use more representative numbers.

This change also locks Bazel at version 5.4.0, since there are a number of
breaking changes in the 6.0.0 release.
@copperlight copperlight merged commit 97a11bb into Netflix:main Dec 21, 2022
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.

2 participants