Skip to content

Commit 271251f

Browse files
vshankaridryomov
authored andcommitted
ceph: use tracked average r/w/m latencies to display metrics in debugfs
Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent 54d7b82 commit 271251f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

fs/ceph/debugfs.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int metrics_latency_show(struct seq_file *s, void *p)
175175
struct ceph_fs_client *fsc = s->private;
176176
struct ceph_client_metric *cm = &fsc->mdsc->metric;
177177
struct ceph_metric *m;
178-
s64 total, sum, avg, min, max, sq;
178+
s64 total, avg, min, max, sq;
179179
int i;
180180

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

0 commit comments

Comments
 (0)