Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use general instead of string interpolation in example #151

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

DieBauer
Copy link
Contributor

@DieBauer DieBauer commented Dec 5, 2023

The generated dashboard shows a quantile of '0.98999999999999999' (99/100) instead of a nicer 0.99 (

"expr": "histogram_quantile(0.98999999999999999,\n sum by (le) (\n rate(request_duration_seconds_bucket{cluster=\"$cluster\",namespace=\"$namespace\",job=~\".*/faro-api\"}[$__rate_interval])\n )\n) * 1e3\n",
).
By changing the interpolation from string (%s) to general (%g) this is more correct (see https://docs.python.org/3/library/string.html#format-specification-mini-language for %g).

It also leaves 0.5 to 1 decimal, and 0.99 to 2, while using %f would format 0.5 as 0.50.

@DieBauer DieBauer requested a review from a team December 5, 2023 07:36
@CLAassistant
Copy link

CLAassistant commented Dec 5, 2023

CLA assistant check
All committers have signed the CLA.

@Duologic
Copy link
Member

Duologic commented Dec 5, 2023

Nice, can you also update the rendered output.json to reflect this change? That should fix the failing smoke test.

The generated dashboard shows a quantile of '0.98999999999999999' (99/100) instead of a nicer 0.99 (https://github.com/grafana/grafonnet/blob/bb2afaffbcefeae1035cd691ab06a486e0022002/examples/redMethod/output.json#L87).
By changing the interpolation from string (%s) to general (%g) this is more correct.

It also leaves 0.5 to 1 decimal, and 0.99 to 2.
@DieBauer DieBauer changed the title Use floating point instead of string interpolation in example Use general instead of string interpolation in example Dec 5, 2023
@DieBauer
Copy link
Contributor Author

DieBauer commented Dec 5, 2023

Thanks, regenerated.

@Duologic Duologic merged commit a1b1499 into grafana:main Dec 5, 2023
2 checks passed
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.

3 participants