aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Gushchin <guro@fb.com>2021-12-03 18:33:49 -0800
committerRoman Gushchin <guro@fb.com>2021-12-03 19:35:53 -0800
commit0eda8062ee9b8129f5e18e285e3ab044a5835fb1 (patch)
tree76730e299f0195e971edb208447c9125c4a641b5
parent8ba833fa6a40bb4af2cb3f0490084e2b7834e840 (diff)
downloadschbench-0eda8062ee9b8129f5e18e285e3ab044a5835fb1.tar.gz
schbench: make percentiles printing prettier
Align numbers and highlight the 99.0%'s asterisk. Print this: Latency percentiles (usec) runtime 30 (s) (670 total samples) 50.0th: 95872 (345 samples) 75.0th: 115584 (158 samples) 90.0th: 129664 (103 samples) 95.0th: 132352 (34 samples) * 99.0th: 135424 (25 samples) 99.5th: 135936 (2 samples) 99.9th: 139008 (3 samples) min=26024, max=138760 instead of: Latency percentiles (usec) runtime 30 (s) (4005 total samples) 50.0th: 40 (2032 samples) 75.0th: 1410 (972 samples) 90.0th: 2868 (601 samples) 95.0th: 4312 (229 samples) *99.0th: 12272 (131 samples) 99.5th: 12944 (20 samples) 99.9th: 18720 (16 samples) min=6, max=23405 Signed-off-by: Roman Gushchin <guro@fb.com>
-rw-r--r--schbench.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/schbench.c b/schbench.c
index 89aa3bb..a257105 100644
--- a/schbench.c
+++ b/schbench.c
@@ -408,8 +408,8 @@ static void show_latencies(struct stats *s, unsigned long long runtime)
if (len) {
fprintf(stderr, "Latency percentiles (usec) runtime %llu (s) (%lu total samples)\n", runtime, s->nr_samples);
for (i = 0; i < len; i++)
- fprintf(stderr, "\t%s%2.1fth: %u (%lu samples)\n",
- i == PLIST_P99 ? "*" : "",
+ fprintf(stderr, "\t%s%2.1fth: %-10u (%lu samples)\n",
+ i == PLIST_P99 ? "* " : " ",
plist[i], ovals[i], ocounts[i]);
}
@@ -418,7 +418,7 @@ static void show_latencies(struct stats *s, unsigned long long runtime)
if (ocounts)
free(ocounts);
- fprintf(stderr, "\tmin=%u, max=%u\n", s->min, s->max);
+ fprintf(stderr, "\t min=%u, max=%u\n", s->min, s->max);
}
/* fold latency info from s into d */