Skip to content

Commit

Permalink
perf(473): Add db address label to reducer queue length (#489)
Browse files Browse the repository at this point in the history
Closes #473.
  • Loading branch information
joshua-spacetime authored and John Detter committed Oct 31, 2023
1 parent 9d80f7d commit b361be1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
7 changes: 4 additions & 3 deletions crates/core/src/host/module_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,10 @@ pub enum InitDatabaseError {
impl ModuleHost {
pub fn new(threadpool: Arc<HostThreadpool>, mut module: impl Module) -> Self {
let info = module.info();
let waiter_gauge = WORKER_METRICS
.instance_queue_length
.with_label_values(&info.identity, &info.module_hash);
let waiter_gauge =
WORKER_METRICS
.instance_queue_length
.with_label_values(&info.identity, &info.module_hash, &info.address);
let instance_pool = LendingPool::new(waiter_gauge);
instance_pool.add_multiple(module.initial_instances()).unwrap();
let inner = Arc::new(HostControllerActor {
Expand Down
16 changes: 1 addition & 15 deletions crates/core/src/worker_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,8 @@ metrics_group!(

#[name = spacetime_worker_instance_operation_queue_length]
#[help = "Length of the wait queue for access to a module instance."]
#[labels(identity: Identity, module_hash: Hash)]
#[labels(identity: Identity, module_hash: Hash, database_address: Address)]
pub instance_queue_length: IntGaugeVec,
// #[name = spacetime_instance_env_delete_pk]
// #[help = "Time spent by reducers deleting rows by pk (InstanceEnv::delete_pk)"]
// #[labels(database_address, table_id)]
// pub instance_env_delete_pk: HistogramVec,

// #[name = spacetime_instance_env_delete_value]
// #[help = "Time spent by reducers deleting rows (InstanceEnv::delete_value)"]
// #[labels(database_address, table_id)]
// pub instance_env_delete_value: HistogramVec,

// #[name = spacetime_instance_env_delete_range]
// #[help = "Time spent by reducers deleting rows ranges eq (InstanceEnv::delete_range)"]
// #[labels(database_address, table_id)]
// pub instance_env_delete_range: HistogramVec,
}
);

Expand Down

0 comments on commit b361be1

Please sign in to comment.