diff --git a/Cargo.lock b/Cargo.lock index 6b24cb822c5..804cfc87cdc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -449,7 +449,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "librocksdb_sys" version = "0.1.0" -source = "git+https://github.com/pingcap/rust-rocksdb.git#1bb369b6960a8eafcf289b79ee324028948f844c" +source = "git+https://github.com/pingcap/rust-rocksdb.git#a2da29b19304eefc058f25eb91d6f15c0395d35a" dependencies = [ "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -760,7 +760,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rocksdb" version = "0.3.0" -source = "git+https://github.com/pingcap/rust-rocksdb.git#1bb369b6960a8eafcf289b79ee324028948f844c" +source = "git+https://github.com/pingcap/rust-rocksdb.git#a2da29b19304eefc058f25eb91d6f15c0395d35a" dependencies = [ "crc 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/src/util/rocksdb/engine_metrics.rs b/src/util/rocksdb/engine_metrics.rs index f98ccdaf555..1131e995e4b 100644 --- a/src/util/rocksdb/engine_metrics.rs +++ b/src/util/rocksdb/engine_metrics.rs @@ -63,6 +63,10 @@ pub const ENGINE_TICKER_TYPES: &'static [TickerType] = &[ TickerType::BloomFilterPrefixUseful, TickerType::WalFileSynced, TickerType::WalFileBytes, + TickerType::WriteDoneBySelf, + TickerType::WriteDoneByOther, + TickerType::WriteTimeout, + TickerType::WriteWithWAL, TickerType::CompactReadBytes, TickerType::CompactWriteBytes, TickerType::FlushWriteBytes, @@ -176,19 +180,19 @@ pub fn flush_engine_ticker_metrics(t: TickerType, value: u64, name: &str) { .unwrap(); } TickerType::GetHitL0 => { - STORE_ENGINE_READ_SURVED_VEC + STORE_ENGINE_GET_SERVED_VEC .with_label_values(&[name, "get_hit_l0"]) .inc_by(value as f64) .unwrap(); } TickerType::GetHitL1 => { - STORE_ENGINE_READ_SURVED_VEC + STORE_ENGINE_GET_SERVED_VEC .with_label_values(&[name, "get_hit_l1"]) .inc_by(value as f64) .unwrap(); } TickerType::GetHitL2AndUp => { - STORE_ENGINE_READ_SURVED_VEC + STORE_ENGINE_GET_SERVED_VEC .with_label_values(&[name, "get_hit_l2_and_up"]) .inc_by(value as f64) .unwrap(); @@ -337,6 +341,30 @@ pub fn flush_engine_ticker_metrics(t: TickerType, value: u64, name: &str) { .inc_by(value as f64) .unwrap(); } + TickerType::WriteDoneBySelf => { + STORE_ENGINE_WRITE_SERVED_VEC + .with_label_values(&[name, "write_done_by_self"]) + .inc_by(value as f64) + .unwrap(); + } + TickerType::WriteDoneByOther => { + STORE_ENGINE_WRITE_SERVED_VEC + .with_label_values(&[name, "write_done_by_other"]) + .inc_by(value as f64) + .unwrap(); + } + TickerType::WriteTimeout => { + STORE_ENGINE_WRITE_SERVED_VEC + .with_label_values(&[name, "write_timeout"]) + .inc_by(value as f64) + .unwrap(); + } + TickerType::WriteWithWAL => { + STORE_ENGINE_WRITE_SERVED_VEC + .with_label_values(&[name, "write_with_wal"]) + .inc_by(value as f64) + .unwrap(); + } TickerType::CompactReadBytes => { STORE_ENGINE_COMPACTION_FLOW_VEC .with_label_values(&[name, "bytes_read"]) @@ -868,10 +896,17 @@ lazy_static!{ &["db", "type"] ).unwrap(); - pub static ref STORE_ENGINE_READ_SURVED_VEC: CounterVec = + pub static ref STORE_ENGINE_GET_SERVED_VEC: CounterVec = register_counter_vec!( "tikv_engine_get_served", - "Get queries served by", + "Get queries served by engine", + &["db", "type"] + ).unwrap(); + + pub static ref STORE_ENGINE_WRITE_SERVED_VEC: CounterVec = + register_counter_vec!( + "tikv_engine_write_served", + "Write queries served by engine", &["db", "type"] ).unwrap();