Skip to content

Commit

Permalink
ceph: add a new metric to keep track of remote object copies
Browse files Browse the repository at this point in the history
This patch adds latency and size metrics for remote object copies
operations ("copyfrom").  For now, these metrics will be available on the
client only, they won't be sent to the MDS.

Signed-off-by: Luís Henriques <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
luis-henrix authored and idryomov committed Nov 8, 2021
1 parent aca39d9 commit c02cb7b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ceph/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ static int metrics_file_show(struct seq_file *s, void *p)
static const char * const metric_str[] = {
"read",
"write",
"metadata"
"metadata",
"copyfrom"
};
static int metrics_latency_show(struct seq_file *s, void *p)
{
Expand Down
4 changes: 4 additions & 0 deletions fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,10 @@ static ssize_t ceph_do_objects_copy(struct ceph_inode_info *src_ci, u64 *src_off
else {
ceph_osdc_start_request(osdc, req, false);
ret = ceph_osdc_wait_request(osdc, req);
ceph_update_copyfrom_metrics(&fsc->mdsc->metric,
req->r_start_latency,
req->r_end_latency,
object_size, ret);
ceph_osdc_put_request(req);
}
if (ret) {
Expand Down
8 changes: 8 additions & 0 deletions fs/ceph/metric.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ enum metric_type {
METRIC_READ,
METRIC_WRITE,
METRIC_METADATA,
METRIC_COPYFROM,
METRIC_MAX
};

Expand Down Expand Up @@ -214,4 +215,11 @@ static inline void ceph_update_metadata_metrics(struct ceph_client_metric *m,
ceph_update_metrics(&m->metric[METRIC_METADATA],
r_start, r_end, 0, rc);
}
static inline void ceph_update_copyfrom_metrics(struct ceph_client_metric *m,
ktime_t r_start, ktime_t r_end,
unsigned int size, int rc)
{
ceph_update_metrics(&m->metric[METRIC_COPYFROM],
r_start, r_end, size, rc);
}
#endif /* _FS_CEPH_MDS_METRIC_H */

0 comments on commit c02cb7b

Please sign in to comment.