Skip to content

Commit

Permalink
add more metrics
Browse files Browse the repository at this point in the history
Signed-off-by: gengliqi <gengliqiii@gmail.com>
  • Loading branch information
gengliqi committed Nov 22, 2021
1 parent ebd6b76 commit 441465c
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 43 deletions.
3 changes: 3 additions & 0 deletions components/raftstore/src/store/async_io/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,10 @@ where
now = Instant::now();
let callback_time = duration_to_sec(now.saturating_duration_since(now2));
STORE_WRITE_CALLBACK_DURATION_HISTOGRAM.observe(callback_time);

let total_cost = now.saturating_duration_since(timer);
STORE_WRITE_TO_DB_DURATION_HISTOGRAM.observe(duration_to_sec(total_cost));

slow_log!(
total_cost,
"[store {}] async write too slow, write_kv: {}s, write_raft: {}s, send: {}s, callback: {}s thread: {}",
Expand Down
8 changes: 7 additions & 1 deletion components/raftstore/src/store/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,15 @@ lazy_static! {
"Bucketed histogram of sending callback to store thread duration.",
exponential_buckets(0.00001, 2.0, 26).unwrap()
).unwrap();
pub static ref STORE_WRITE_LOOP_DURATION_HISTOGRAM: Histogram =
pub static ref STORE_WRITE_TO_DB_DURATION_HISTOGRAM: Histogram =
register_histogram!(
"tikv_raftstore_append_log_duration_seconds",
"Bucketed histogram of peer appending log duration.",
exponential_buckets(0.00001, 2.0, 26).unwrap()
).unwrap();
pub static ref STORE_WRITE_LOOP_DURATION_HISTOGRAM: Histogram =
register_histogram!(
"tikv_raftstore_store_write_loop_duration_seconds",
"Bucketed histogram of store write loop duration.",
exponential_buckets(0.00001, 2.0, 26).unwrap()
).unwrap();
Expand Down
Loading

0 comments on commit 441465c

Please sign in to comment.