Skip to content

Commit

Permalink
ceph: use tracked average r/w/m latencies to display metrics in debugfs
Browse files Browse the repository at this point in the history
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Venky Shankar authored and Ilya Dryomov committed Mar 21, 2022
1 parent 54d7b82 commit 271251f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/ceph/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static int metrics_latency_show(struct seq_file *s, void *p)
struct ceph_fs_client *fsc = s->private;
struct ceph_client_metric *cm = &fsc->mdsc->metric;
struct ceph_metric *m;
s64 total, sum, avg, min, max, sq;
s64 total, avg, min, max, sq;
int i;

seq_printf(s, "item total avg_lat(us) min_lat(us) max_lat(us) stdev(us)\n");
Expand All @@ -185,8 +185,7 @@ static int metrics_latency_show(struct seq_file *s, void *p)
m = &cm->metric[i];
spin_lock(&m->lock);
total = m->total;
sum = m->latency_sum;
avg = total > 0 ? DIV64_U64_ROUND_CLOSEST(sum, total) : 0;
avg = m->latency_avg;
min = m->latency_min;
max = m->latency_max;
sq = m->latency_sq_sum;
Expand Down

0 comments on commit 271251f

Please sign in to comment.