Skip to content

Commit

Permalink
stat: add diskutil aggregated sectors to normal output
Browse files Browse the repository at this point in the history
Since we are now collecting sectors in the disk utilization data we
should include them in the aggregated data as well.

I tested this with an LVM mirror. I also tested this on an mdadm mirror
but all the aggregated and slave data was zero.

Fixes: 75cbc26 ("diskutil: Report how
many sectors have been read and written")
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Jul 14, 2023
1 parent fc25013 commit bb08a26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,11 +957,13 @@ static void show_agg_stats(struct disk_util_agg *agg, int terse,
return;

if (!terse) {
log_buf(out, ", aggrios=%llu/%llu, aggrmerge=%llu/%llu, "
"aggrticks=%llu/%llu, aggrin_queue=%llu, "
"aggrutil=%3.2f%%",
log_buf(out, ", aggrios=%llu/%llu, aggsectors=%llu/%llu, "
"aggrmerge=%llu/%llu, aggrticks=%llu/%llu, "
"aggrin_queue=%llu, aggrutil=%3.2f%%",
(unsigned long long) agg->ios[0] / agg->slavecount,
(unsigned long long) agg->ios[1] / agg->slavecount,
(unsigned long long) agg->sectors[0] / agg->slavecount,
(unsigned long long) agg->sectors[1] / agg->slavecount,
(unsigned long long) agg->merges[0] / agg->slavecount,
(unsigned long long) agg->merges[1] / agg->slavecount,
(unsigned long long) agg->ticks[0] / agg->slavecount,
Expand Down

0 comments on commit bb08a26

Please sign in to comment.