Skip to content

Commit

Permalink
feat: add more percentiles to histogram stats (#99)
Browse files Browse the repository at this point in the history
Add p1, p5 and p99 to all fields where we are collecting percentile
values.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
  • Loading branch information
bajtos authored Dec 12, 2023
1 parent 027c390 commit 14790c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/retrieval-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const addHistogramToPoint = (point, values, fieldNamePrefix = '') => {
point.intField(`${fieldNamePrefix}min`, values[0])
point.intField(`${fieldNamePrefix}mean`, values.reduce((sum, v) => sum + BigInt(v), 0n) / BigInt(count))
point.intField(`${fieldNamePrefix}max`, values[count - 1])
for (const p of [10, 50, 90, 95]) {
for (const p of [1, 5, 10, 50, 90, 95, 99]) {
point.intField(`${fieldNamePrefix}p${p}`, getValueAtPercentile(values, p))
}
}
Expand Down

0 comments on commit 14790c3

Please sign in to comment.