histogram query

This commit is contained in:
GroovieGermanikus 2024-03-28 16:04:05 +01:00
parent 7b2cdc7386
commit 4bf29f9e4f
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
1 changed files with 14 additions and 0 deletions

View File

@ -17,3 +17,17 @@ SELECT * FROM benchrunner.bench_metrics_confirmation_rate
ORDER BY ts DESC
```
```postgresql
-- note: arrays are 1-based; histogram array has 21 elements
SELECT
ts,
average_confirmation_time_ms,
histogram_confirmation_time_ms[1] as p_min,
histogram_confirmation_time_ms[19] as p90,
histogram_confirmation_time_ms[20] as p95,
histogram_confirmation_time_ms[21] as p_max
FROM benchrunner.bench_metrics_confirmation_rate
ORDER BY ts DESC
```