From 36966d155fb918b53c71904f2e194f5b9773d713 Mon Sep 17 00:00:00 2001 From: David Zeng Date: Sun, 9 Oct 2022 11:26:09 +0800 Subject: [PATCH] Output the p50,p95,p99 latency with histogram. --- src/sb_histogram.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sb_histogram.c b/src/sb_histogram.c index 88c9ad6fe..c313db5ae 100644 --- a/src/sb_histogram.c +++ b/src/sb_histogram.c @@ -326,6 +326,11 @@ void sb_histogram_print(sb_histogram_t *h) (unsigned long) array[i]); /* count */ } + printf(" 50th percentile: %35.2f\n", get_pct_cumulative(h, 50)); + printf(" 90th percentile: %35.2f\n", get_pct_cumulative(h, 90)); + printf(" 95th percentile: %35.2f\n", get_pct_cumulative(h, 95)); + printf(" 99th percentile: %35.2f\n", get_pct_cumulative(h, 99)); + pthread_rwlock_unlock(&h->lock); }