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 Oct 28, 2023
1 parent feaba24 commit 88952b3
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 @@ -476,9 +476,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

1 comment on commit 88952b3

@github-actions
Copy link

@github-actions github-actions bot commented on 88952b3 Oct 28, 2023

Choose a reason for hiding this comment

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

Benchmarking failed. Please check the workflow run for details.

Please sign in to comment.