ceph: add caps perf metric for each superblock
Count hits and misses in the caps cache. If the client has all of the necessary caps when a task needs references, then it's counted as a hit. Any other situation is a miss. URL: https://tracker.ceph.com/issues/43215 Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
@@ -129,6 +129,7 @@ static int metric_show(struct seq_file *s, void *p)
|
||||
struct ceph_fs_client *fsc = s->private;
|
||||
struct ceph_mds_client *mdsc = fsc->mdsc;
|
||||
struct ceph_client_metric *m = &mdsc->metric;
|
||||
int i, nr_caps = 0;
|
||||
|
||||
seq_printf(s, "item total miss hit\n");
|
||||
seq_printf(s, "-------------------------------------------------\n");
|
||||
@@ -138,6 +139,21 @@ static int metric_show(struct seq_file *s, void *p)
|
||||
percpu_counter_sum(&m->d_lease_mis),
|
||||
percpu_counter_sum(&m->d_lease_hit));
|
||||
|
||||
mutex_lock(&mdsc->mutex);
|
||||
for (i = 0; i < mdsc->max_sessions; i++) {
|
||||
struct ceph_mds_session *s;
|
||||
|
||||
s = __ceph_lookup_mds_session(mdsc, i);
|
||||
if (!s)
|
||||
continue;
|
||||
nr_caps += s->s_nr_caps;
|
||||
ceph_put_mds_session(s);
|
||||
}
|
||||
mutex_unlock(&mdsc->mutex);
|
||||
seq_printf(s, "%-14s%-16d%-16lld%lld\n", "caps", nr_caps,
|
||||
percpu_counter_sum(&m->i_caps_mis),
|
||||
percpu_counter_sum(&m->i_caps_hit));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user