All of lore.kernel.org
 help / color / mirror / Atom feed
From: Venky Shankar <vshankar@redhat.com>
To: jlayton@redhat.com, pdonnell@redhat.com, xiubli@redhat.com
Cc: ceph-devel@vger.kernel.org, Venky Shankar <vshankar@redhat.com>
Subject: [PATCH v1 4/4] ceph: use tracked average r/w/m latencies to display metrics in debugfs
Date: Mon, 13 Sep 2021 18:43:11 +0530	[thread overview]
Message-ID: <20210913131311.1347903-5-vshankar@redhat.com> (raw)
In-Reply-To: <20210913131311.1347903-1-vshankar@redhat.com>

Signed-off-by: Venky Shankar <vshankar@redhat.com>
---
 fs/ceph/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index 9153bc233e08..e3fccf7c6fb5 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -173,7 +173,7 @@ static int metric_show(struct seq_file *s, void *p)
 	spin_lock(&m->read_latency_lock);
 	total = m->total_reads;
 	sum = m->read_latency_sum;
-	avg = total > 0 ? DIV64_U64_ROUND_CLOSEST(sum, total) : 0;
+	avg = m->avg_read_latency;
 	min = m->read_latency_min;
 	max = m->read_latency_max;
 	sq = m->read_latency_stdev;
@@ -183,7 +183,7 @@ static int metric_show(struct seq_file *s, void *p)
 	spin_lock(&m->write_latency_lock);
 	total = m->total_writes;
 	sum = m->write_latency_sum;
-	avg = total > 0 ? DIV64_U64_ROUND_CLOSEST(sum, total) : 0;
+	avg = m->avg_write_latency;
 	min = m->write_latency_min;
 	max = m->write_latency_max;
 	sq = m->write_latency_stdev;
@@ -193,7 +193,7 @@ static int metric_show(struct seq_file *s, void *p)
 	spin_lock(&m->metadata_latency_lock);
 	total = m->total_metadatas;
 	sum = m->metadata_latency_sum;
-	avg = total > 0 ? DIV64_U64_ROUND_CLOSEST(sum, total) : 0;
+	avg = m->avg_metadata_latency;
 	min = m->metadata_latency_min;
 	max = m->metadata_latency_max;
 	sq = m->metadata_latency_stdev;
-- 
2.27.0


  parent reply	other threads:[~2021-09-13 13:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 13:13 [PATCH v1 0/4] ceph: forward average read/write/metadata latency Venky Shankar
2021-09-13 13:13 ` [PATCH v1 1/4] ceph: use "struct ceph_timespec" for r/w/m latencies Venky Shankar
2021-09-13 13:13 ` [PATCH v1 2/4] ceph: track average/stdev r/w/m latency Venky Shankar
2021-09-13 13:13 ` [PATCH v1 3/4] ceph: include average/stddev r/w/m latency in mds metrics Venky Shankar
2021-09-13 13:13 ` Venky Shankar [this message]
2021-09-13 15:13 ` [PATCH v1 0/4] ceph: forward average read/write/metadata latency Jeff Layton
2021-09-13 15:21   ` Jeff Layton
2021-09-13 15:41     ` Venky Shankar
2021-09-14 12:53   ` Xiubo Li

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=20210913131311.1347903-5-vshankar@redhat.com \
    --to=vshankar@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=jlayton@redhat.com \
    --cc=pdonnell@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.