Implement basic OSD status reporting to Consul

This commit is contained in:
Vitaliy Filippov
2020-04-14 14:52:06 +03:00
parent edf6d6f897
commit 37b27c3025
12 changed files with 246 additions and 53 deletions
+4 -4
View File
@@ -139,8 +139,8 @@ void osd_t::handle_finished_read(osd_client_t & cl)
// Measure subop latency
timespec tv_end;
clock_gettime(CLOCK_REALTIME, &tv_end);
subop_stat_count[request->req.hdr.opcode]++;
subop_stat_sum[request->req.hdr.opcode] += (
subop_stat_count[0][request->req.hdr.opcode]++;
subop_stat_sum[0][request->req.hdr.opcode] += (
(tv_end.tv_sec - request->tv_begin.tv_sec)*1000000 +
(tv_end.tv_nsec - request->tv_begin.tv_nsec)/1000
);
@@ -242,8 +242,8 @@ void osd_t::handle_reply_hdr(osd_client_t *cl)
// Measure subop latency
timespec tv_end;
clock_gettime(CLOCK_REALTIME, &tv_end);
subop_stat_count[op->req.hdr.opcode]++;
subop_stat_sum[op->req.hdr.opcode] += (
subop_stat_count[0][op->req.hdr.opcode]++;
subop_stat_sum[0][op->req.hdr.opcode] += (
(tv_end.tv_sec - op->tv_begin.tv_sec)*1000000 +
(tv_end.tv_nsec - op->tv_begin.tv_nsec)/1000
);