use once_cell::sync::Lazy;
use prometheus::{
exponential_buckets, register_histogram_vec, register_int_counter_vec, HistogramVec,
IntCounterVec,
};
pub static SCHEMADB_ITER_LATENCY_SECONDS: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"schemadb_iter_latency_seconds",
"Schemadb iter latency in seconds",
&["cf_name"],
exponential_buckets( 1e-6, 2.0, 22).unwrap(),
)
.unwrap()
});
pub static SCHEMADB_ITER_BYTES: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"schemadb_iter_bytes",
"Schemadb iter size in bytes",
&["cf_name"]
)
.unwrap()
});
pub static SCHEMADB_GET_LATENCY_SECONDS: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"schemadb_get_latency_seconds",
"Schemadb get latency in seconds",
&["cf_name"],
exponential_buckets( 1e-6, 2.0, 22).unwrap(),
)
.unwrap()
});
pub static SCHEMADB_GET_BYTES: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"schemadb_get_bytes",
"Schemadb get call returned data size in bytes",
&["cf_name"]
)
.unwrap()
});
pub static SCHEMADB_BATCH_COMMIT_LATENCY_SECONDS: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"schemadb_batch_commit_latency_seconds",
"Schemadb schema batch commit latency in seconds",
&["db_name"],
exponential_buckets( 1e-3, 2.0, 20).unwrap(),
)
.unwrap()
});
pub static SCHEMADB_BATCH_COMMIT_BYTES: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"schemadb_batch_commit_bytes",
"Schemadb schema batch commit size in bytes",
&["db_name"]
)
.unwrap()
});
pub static SCHEMADB_PUT_BYTES: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"sov_schema_db_put_bytes",
"sov_schema_db put call puts data size in bytes",
&["cf_name"]
)
.unwrap()
});
pub static SCHEMADB_DELETES: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!("storage_deletes", "Storage delete calls", &["cf_name"]).unwrap()
});
pub static SCHEMADB_BATCH_PUT_LATENCY_SECONDS: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"sov_schema_db_batch_put_latency_seconds",
"sov_schema_db schema batch put latency in seconds",
&["db_name"],
exponential_buckets( 1e-3, 2.0, 20).unwrap(),
)
.unwrap()
});