From: Venky Shankar <vshankar@redhat.com>
To: jlayton@redhat.com, idryomov@gmail.com
Cc: xiubli@redhat.com, ceph-devel@vger.kernel.org,
Venky Shankar <vshankar@redhat.com>
Subject: [PATCH v2 4/4] ceph: use tracked average r/w/m latencies to display metrics in debugfs
Date: Tue, 8 Mar 2022 07:42:19 -0500 [thread overview]
Message-ID: <20220308124219.771527-5-vshankar@redhat.com> (raw)
In-Reply-To: <20220308124219.771527-1-vshankar@redhat.com>
[ jlayton: remove now-unused "sum" variable ]
Signed-off-by: Venky Shankar <vshankar@redhat.com>
---
fs/ceph/debugfs.c | 5 ++---
1 file 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;
--
2.31.1
next prev parent reply other threads:[~2022-03-08 12:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 12:42 [PATCH v2 0/4] ceph: forward average read/write/metadata latency Venky Shankar
2022-03-08 12:42 ` [PATCH v2 1/4] ceph: use ktime_to_timespec64() rather than jiffies_to_timespec64() Venky Shankar
2022-03-08 12:42 ` [PATCH v2 2/4] ceph: track average r/w/m latency Venky Shankar
2022-03-08 12:42 ` [PATCH v2 3/4] ceph: include average/stdev r/w/m latency in mds metrics Venky Shankar
2022-03-08 12:42 ` Venky Shankar [this message]
2022-03-08 12:57 ` [PATCH v2 0/4] ceph: forward average read/write/metadata latency Xiubo Li
2022-03-08 15:58 ` Jeff Layton
-- strict thread matches above, loose matches on Subject: below --
2021-09-14 8:48 Venky Shankar
2021-09-14 8:49 ` [PATCH v2 4/4] ceph: use tracked average r/w/m latencies to display metrics in debugfs Venky Shankar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220308124219.771527-5-vshankar@redhat.com \
--to=vshankar@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jlayton@redhat.com \
--cc=xiubli@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox