Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 1 addition & 31 deletions crates/core/src/db/db_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,18 @@ use std::{collections::HashMap, sync::Mutex};
use crate::execution_context::WorkloadType;
use crate::host::AbiCall;
use once_cell::sync::Lazy;
use prometheus::{GaugeVec, Histogram, HistogramVec, IntCounterVec, IntGaugeVec};
use prometheus::{GaugeVec, HistogramVec, IntCounterVec, IntGaugeVec};
use spacetimedb_lib::Address;
use spacetimedb_metrics::metrics_group;

metrics_group!(
#[non_exhaustive]
pub struct DbMetrics {
#[name = spacetime_tdb_insert_time]
#[help = "Time time it takes for the transactional store to perform an insert"]
pub tdb_insert_time: Histogram,

#[name = spacetime_tdb_delete_time]
#[help = "Time time it takes for the transactional store to perform a delete"]
pub tdb_delete_time: Histogram,

#[name = spacetime_tdb_seek_time]
#[help = "Time time it takes for the transactional store to perform a seek"]
pub tdb_seek_time: Histogram,

#[name = spacetime_tdb_scan_time]
#[help = "Time time it takes for the transactional store to perform a scan"]
pub tdb_scan_time: Histogram,

#[name = spacetime_tdb_commit_time]
#[help = "Time time it takes for the transactional store to perform a Tx commit"]
pub tdb_commit_time: Histogram,

#[name = spacetime_rdb_create_table_time]
#[help = "The time it takes to create a table"]
#[labels(table_name: str)]
pub rdb_create_table_time: HistogramVec,

#[name = spacetime_rdb_drop_table_time]
#[help = "The time spent dropping a table"]
#[labels(table_id: u32)]
pub rdb_drop_table_time: HistogramVec,

#[name = spacetime_rdb_iter_time]
#[help = "The time spent iterating a table"]
#[labels(table_id: u32)]
pub rdb_iter_time: HistogramVec,

#[name = spacetime_rdb_insert_row_time]
#[help = "The time spent inserting into a table"]
#[labels(table_id: u32)]
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/db/relational_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ impl RelationalDB {
tx: &'a MutTx,
table_id: TableId,
) -> Result<Iter<'a>, DBError> {
let _guard = DB_METRICS.rdb_iter_time.with_label_values(&table_id.0).start_timer();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This metric was was used, but it did not measure actual iteration time, just the time to open an iterator.

self.inner.iter_mut_tx(ctx, tx, table_id)
}

Expand Down
21 changes: 1 addition & 20 deletions crates/core/src/worker_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashMap, sync::Mutex};

use crate::hash::Hash;
use once_cell::sync::Lazy;
use prometheus::{Gauge, GaugeVec, HistogramVec, IntCounterVec, IntGaugeVec};
use prometheus::{GaugeVec, HistogramVec, IntCounterVec, IntGaugeVec};
use spacetimedb_lib::{Address, Identity};
use spacetimedb_metrics::metrics_group;

Expand Down Expand Up @@ -33,10 +33,6 @@ metrics_group!(
#[labels(identity: Identity)]
pub websocket_sent_msg_size: HistogramVec,

#[name = spacetime_worker_process_cpu_usage]
#[help = "CPU usage of the worker process."]
pub process_cpu_usage: Gauge,

#[name = spacetime_worker_transactions]
#[help = "Number of reducer calls."]
#[labels(database_address: Address, reducer_symbol: str)]
Expand All @@ -52,21 +48,6 @@ metrics_group!(
#[labels(database_address: Address, reducer_symbol: str)]
pub reducer_write_size: HistogramVec,

#[name = spacetime_worker_identity_energy_budget]
#[help = "Node-level energy budget, per identity"]
#[labels(identity: Identity, node: u64)]
pub node_identity_energy_budget_gauge: GaugeVec,

#[name = spacetime_instance_env_insert]
#[help = "Time spent by reducers inserting rows (InstanceEnv::insert)"]
#[labels(database_address: Address, table_id: u32)]
pub instance_env_insert: HistogramVec,

#[name = spacetime_instance_env_delete_eq]
#[help = "Time spent by reducers deleting rows by eq (InstanceEnv::delete_eq)"]
#[labels(database_address: Address, table_id: u32)]
pub instance_env_delete_eq: HistogramVec,

#[name = spacetime_worker_instance_operation_queue_length]
#[help = "Length of the wait queue for access to a module instance."]
#[labels(database_address: Address)]
Expand Down