Measure OP_STAB in both ways
parent
2575431176
commit
2a5ca4ff6f
2
osd.cpp
2
osd.cpp
|
@ -50,7 +50,7 @@ osd_t::osd_t(blockstore_config_t & config, blockstore_t *bs, ring_loop_t *ringlo
|
||||||
}
|
}
|
||||||
if (send_stat_count != 0)
|
if (send_stat_count != 0)
|
||||||
{
|
{
|
||||||
printf("avg latency to send subops with data: %ld us\n", send_stat_sum/send_stat_count);
|
printf("avg latency to send stabilize subop: %ld us\n", send_stat_sum/send_stat_count);
|
||||||
send_stat_count = 0;
|
send_stat_count = 0;
|
||||||
send_stat_sum = 0;
|
send_stat_sum = 0;
|
||||||
}
|
}
|
||||||
|
|
24
osd_send.cpp
24
osd_send.cpp
|
@ -34,15 +34,11 @@ bool osd_t::try_send(osd_client_t & cl)
|
||||||
cl.write_op = cl.outbox.front();
|
cl.write_op = cl.outbox.front();
|
||||||
cl.outbox.pop_front();
|
cl.outbox.pop_front();
|
||||||
cl.write_state = CL_WRITE_REPLY;
|
cl.write_state = CL_WRITE_REPLY;
|
||||||
if (cl.write_op->op_type == OSD_OP_OUT)
|
|
||||||
{
|
|
||||||
clock_gettime(CLOCK_REALTIME, &cl.write_op->tv_send);
|
clock_gettime(CLOCK_REALTIME, &cl.write_op->tv_send);
|
||||||
}
|
if (cl.write_op->op_type == OSD_OP_IN)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Measure execution latency
|
// Measure execution latency
|
||||||
timespec tv_end;
|
timespec tv_end = cl.write_op->tv_send;
|
||||||
clock_gettime(CLOCK_REALTIME, &tv_end);
|
|
||||||
op_stat_count[cl.write_op->req.hdr.opcode]++;
|
op_stat_count[cl.write_op->req.hdr.opcode]++;
|
||||||
op_stat_sum[cl.write_op->req.hdr.opcode] += (
|
op_stat_sum[cl.write_op->req.hdr.opcode] += (
|
||||||
(tv_end.tv_sec - cl.write_op->tv_begin.tv_sec)*1000000 +
|
(tv_end.tv_sec - cl.write_op->tv_begin.tv_sec)*1000000 +
|
||||||
|
@ -105,15 +101,7 @@ void osd_t::handle_send(ring_data_t *data, int peer_fd)
|
||||||
if (cur_op->send_list.sent >= cur_op->send_list.count)
|
if (cur_op->send_list.sent >= cur_op->send_list.count)
|
||||||
{
|
{
|
||||||
// Done
|
// Done
|
||||||
if (cur_op->op_type == OSD_OP_IN)
|
if (cur_op->req.hdr.opcode == OSD_OP_SECONDARY_STABILIZE)
|
||||||
{
|
|
||||||
delete cur_op;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Measure subops with data
|
|
||||||
if (cur_op->req.hdr.opcode == OSD_OP_SECONDARY_STABILIZE ||
|
|
||||||
cur_op->req.hdr.opcode == OSD_OP_SECONDARY_WRITE)
|
|
||||||
{
|
{
|
||||||
timespec tv_end;
|
timespec tv_end;
|
||||||
clock_gettime(CLOCK_REALTIME, &tv_end);
|
clock_gettime(CLOCK_REALTIME, &tv_end);
|
||||||
|
@ -123,6 +111,12 @@ void osd_t::handle_send(ring_data_t *data, int peer_fd)
|
||||||
(tv_end.tv_nsec - cl.write_op->tv_send.tv_nsec)/1000
|
(tv_end.tv_nsec - cl.write_op->tv_send.tv_nsec)/1000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (cur_op->op_type == OSD_OP_IN)
|
||||||
|
{
|
||||||
|
delete cur_op;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
cl.sent_ops[cl.write_op->req.hdr.id] = cl.write_op;
|
cl.sent_ops[cl.write_op->req.hdr.id] = cl.write_op;
|
||||||
}
|
}
|
||||||
cl.write_op = NULL;
|
cl.write_op = NULL;
|
||||||
|
|
Loading…
Reference in New Issue