Skip to content

Commit c02cb7b

Browse files
Luís Henriquesidryomov
authored andcommitted
ceph: add a new metric to keep track of remote object copies
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]>
1 parent aca39d9 commit c02cb7b

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

fs/ceph/debugfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ static int metrics_file_show(struct seq_file *s, void *p)
167167
static const char * const metric_str[] = {
168168
"read",
169169
"write",
170-
"metadata"
170+
"metadata",
171+
"copyfrom"
171172
};
172173
static int metrics_latency_show(struct seq_file *s, void *p)
173174
{

fs/ceph/file.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,6 +2304,10 @@ static ssize_t ceph_do_objects_copy(struct ceph_inode_info *src_ci, u64 *src_off
23042304
else {
23052305
ceph_osdc_start_request(osdc, req, false);
23062306
ret = ceph_osdc_wait_request(osdc, req);
2307+
ceph_update_copyfrom_metrics(&fsc->mdsc->metric,
2308+
req->r_start_latency,
2309+
req->r_end_latency,
2310+
object_size, ret);
23072311
ceph_osdc_put_request(req);
23082312
}
23092313
if (ret) {

fs/ceph/metric.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ enum metric_type {
129129
METRIC_READ,
130130
METRIC_WRITE,
131131
METRIC_METADATA,
132+
METRIC_COPYFROM,
132133
METRIC_MAX
133134
};
134135

@@ -214,4 +215,11 @@ static inline void ceph_update_metadata_metrics(struct ceph_client_metric *m,
214215
ceph_update_metrics(&m->metric[METRIC_METADATA],
215216
r_start, r_end, 0, rc);
216217
}
218+
static inline void ceph_update_copyfrom_metrics(struct ceph_client_metric *m,
219+
ktime_t r_start, ktime_t r_end,
220+
unsigned int size, int rc)
221+
{
222+
ceph_update_metrics(&m->metric[METRIC_COPYFROM],
223+
r_start, r_end, size, rc);
224+
}
217225
#endif /* _FS_CEPH_MDS_METRIC_H */

0 commit comments

Comments
 (0)