search for: humanrate

Displaying 2 results from an estimated 2 matches for "humanrate".

2019 Dec 04
6
[PATCH nbdkit v3 0/5] filters: stats: More useful, more friendly
...I tried the idea of showing global stats in separate "total" section, but it became messy and hard to implemnt, so I tried the simpler solution of showing both operation rate and total rate in the operation line. Nir Soffer (5): filters: stats: Add maybe() helper filters: stats: Add humanrate() helper filters: stats: Show time per operation filters: stats: Show both operation and total rates filters: stats: Show total stats filters/stats/nbdkit-stats-filter.pod | 10 +++--- filters/stats/stats.c | 46 ++++++++++++++++++++++----- 2 files changed, 43 insertions(+),...
2019 Dec 04
0
[PATCH nbdkit v3 5/5] filters: stats: Show total stats
...tatic void +print_totals (uint64_t usecs) +{ + uint64_t ops = pread_st.ops + pwrite_st.ops + trim_st.ops + zero_st.ops + + extents_st.ops + flush_st.ops; + uint64_t bytes = pread_st.bytes + pwrite_st.bytes + trim_st.bytes + + zero_st.bytes; + char *size = humansize (bytes); + char *rate = humanrate (bytes, usecs); + + fprintf (fp, "total: %" PRIu64 " ops, %.6f s, %s, %s/s\n", + ops, usecs / 1000000.0, maybe (size), maybe (rate)); + + free (size); + free (rate); +} + static inline void print_stats (int64_t usecs) { - fprintf (fp, "elapsed time: %.6f s\...