Measure OSD op/subop latency
Something is wrong: loopback RTT between OSDs is sometimes as high as 70us (should be 20us or less probably)
This commit is contained in:
@@ -90,6 +90,14 @@ void osd_t::handle_read(ring_data_t *data, int peer_fd)
|
||||
cl.sent_ops.erase(req_it);
|
||||
cl.read_reply_id = 0;
|
||||
cl.read_state = 0;
|
||||
// Measure subop latency
|
||||
timeval tv_end;
|
||||
gettimeofday(&tv_end, NULL);
|
||||
subop_stat_count[request->req.hdr.opcode]++;
|
||||
subop_stat_sum[request->req.hdr.opcode] += (
|
||||
(tv_end.tv_sec - request->tv_begin.tv_sec)*1000000 +
|
||||
tv_end.tv_usec - request->tv_begin.tv_usec
|
||||
);
|
||||
request->callback(request);
|
||||
}
|
||||
}
|
||||
@@ -182,6 +190,14 @@ void osd_t::handle_reply_hdr(osd_client_t *cl)
|
||||
{
|
||||
cl->read_state = 0;
|
||||
cl->sent_ops.erase(req_it);
|
||||
// Measure subop latency
|
||||
timeval tv_end;
|
||||
gettimeofday(&tv_end, NULL);
|
||||
subop_stat_count[op->req.hdr.opcode]++;
|
||||
subop_stat_sum[op->req.hdr.opcode] += (
|
||||
(tv_end.tv_sec - op->tv_begin.tv_sec)*1000000 +
|
||||
tv_end.tv_usec - op->tv_begin.tv_usec
|
||||
);
|
||||
op->callback(op);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user