Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sitalkedia committed Oct 3, 2023
1 parent 8fa163e commit b5dfbce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 6 additions & 3 deletions storage/schemadb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ pub mod iterator;
use crate::{
metrics::{
APTOS_SCHEMADB_BATCH_COMMIT_BYTES, APTOS_SCHEMADB_BATCH_COMMIT_LATENCY_SECONDS,
APTOS_SCHEMADB_DELETES_SAMPLED, APTOS_SCHEMADB_GET_BYTES, APTOS_SCHEMADB_GET_LATENCY_SECONDS,
APTOS_SCHEMADB_ITER_BYTES, APTOS_SCHEMADB_ITER_LATENCY_SECONDS, APTOS_SCHEMADB_PUT_BYTES_SAMPLED,
APTOS_SCHEMADB_DELETES_SAMPLED, APTOS_SCHEMADB_GET_BYTES,
APTOS_SCHEMADB_GET_LATENCY_SECONDS, APTOS_SCHEMADB_ITER_BYTES,
APTOS_SCHEMADB_ITER_LATENCY_SECONDS, APTOS_SCHEMADB_PUT_BYTES_SAMPLED,
APTOS_SCHEMADB_SEEK_LATENCY_SECONDS,
},
schema::{KeyCodec, Schema, SeekKeyCodec, ValueCodec},
Expand Down Expand Up @@ -262,7 +263,9 @@ impl DB {
.observe((key.len() + value.len()) as f64);
},
WriteOp::Deletion { key: _ } => {
APTOS_SCHEMADB_DELETES_SAMPLED.with_label_values(&[cf_name]).inc();
APTOS_SCHEMADB_DELETES_SAMPLED
.with_label_values(&[cf_name])
.inc();
},
}
}
Expand Down
8 changes: 5 additions & 3 deletions storage/schemadb/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ pub static APTOS_SCHEMADB_PUT_BYTES_SAMPLED: Lazy<HistogramVec> = Lazy::new(|| {
});

pub static APTOS_SCHEMADB_DELETES_SAMPLED: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!("aptos_storage_deletes_sampled", "Aptos storage delete calls (sampled)", &[
"cf_name"
])
register_int_counter_vec!(
"aptos_storage_deletes_sampled",
"Aptos storage delete calls (sampled)",
&["cf_name"]
)
.unwrap()
});

0 comments on commit b5dfbce

Please sign in to comment.