diff options
author | Venky Shankar <vshankar@redhat.com> | 2022-03-08 15:42:19 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2022-03-21 15:35:16 +0300 |
commit | 271251f841a53ce20c4e49047278e06c205a8ebd (patch) | |
tree | ff6e13ecf8430f87641b42010401ca32a10f1d60 /fs/ceph | |
parent | 54d7b821a37fdb805ffc8545e536fb228c1113b2 (diff) | |
download | linux-271251f841a53ce20c4e49047278e06c205a8ebd.tar.xz |
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>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/debugfs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index 3cf7c9c1085b..bec3c4549c07 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c @@ -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"); @@ -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; |