diff --git a/src/messenger.h b/src/messenger.h index 0347fb9b..6c455f67 100644 --- a/src/messenger.h +++ b/src/messenger.h @@ -173,6 +173,8 @@ public: bool connect_rdma(int peer_fd, std::string rdma_address, uint64_t client_max_msg); #endif + void measure_exec(osd_op_t *cur_op); + protected: void try_connect_peer(uint64_t osd_num); void try_connect_peer_addr(osd_num_t peer_osd, const char *peer_host, int peer_port); @@ -184,7 +186,6 @@ protected: void cancel_op(osd_op_t *op); bool try_send(osd_client_t *cl); - void measure_exec(osd_op_t *cur_op); void handle_send(int result, osd_client_t *cl); bool handle_read(int result, osd_client_t *cl); diff --git a/src/msgr_send.cpp b/src/msgr_send.cpp index 32348e17..1e68b380 100644 --- a/src/msgr_send.cpp +++ b/src/msgr_send.cpp @@ -150,8 +150,10 @@ void osd_messenger_t::measure_exec(osd_op_t *cur_op) (cur_op->tv_end.tv_nsec - cur_op->tv_begin.tv_nsec)/1000 ); if (cur_op->req.hdr.opcode == OSD_OP_READ || - cur_op->req.hdr.opcode == OSD_OP_WRITE) + cur_op->req.hdr.opcode == OSD_OP_WRITE || + cur_op->req.hdr.opcode == OSD_OP_SCRUB) { + // req.rw.len is internally set to the full object size for scrubs stats.op_stat_bytes[cur_op->req.hdr.opcode] += cur_op->req.rw.len; } else if (cur_op->req.hdr.opcode == OSD_OP_SEC_READ || diff --git a/src/osd_primary_subops.cpp b/src/osd_primary_subops.cpp index 48fa4dd5..6a05fd9b 100644 --- a/src/osd_primary_subops.cpp +++ b/src/osd_primary_subops.cpp @@ -87,6 +87,7 @@ void osd_t::finish_op(osd_op_t *cur_op, int retval) cur_op->reply.hdr.retval = retval; if (cur_op->peer_fd == -1) { + msgr.measure_exec(cur_op); // Copy lambda to be unaffected by `delete op` std::function(cur_op->callback)(cur_op); } diff --git a/src/osd_scrub.cpp b/src/osd_scrub.cpp index c6b7bcdb..65809ffc 100644 --- a/src/osd_scrub.cpp +++ b/src/osd_scrub.cpp @@ -380,6 +380,7 @@ void osd_t::continue_primary_scrub(osd_op_t *cur_op) goto resume_2; { auto & pg = pgs.at({ .pool_id = INODE_POOL(op_data->oid.inode), .pg_num = op_data->pg_num }); + cur_op->req.rw.len = bs_block_size * pg.pg_data_size; // Determine version auto vo_it = pg.ver_override.find(op_data->oid); op_data->target_ver = vo_it != pg.ver_override.end() ? vo_it->second : UINT64_MAX;