Skip to content

Commit 835f929

Browse files
committed
Auto merge of #608 - Mark-Simulacrum:opt, r=Mark-Simulacrum
Track time waiting on mutex lock
2 parents ac50f77 + 191ea00 commit 835f929

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/server/routes/agent.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ fn endpoint_record_progress(
161161
) -> Fallible<Response<Body>> {
162162
let start = std::time::Instant::now();
163163
let data = mutex.lock().unwrap();
164+
let lock_wait = start.elapsed();
164165
let ex = Experiment::get(&data.db, &result.experiment_name)?
165166
.ok_or_else(|| err_msg("no experiment run by this agent"))?;
166167

@@ -175,6 +176,10 @@ fn endpoint_record_progress(
175176
.crater_endpoint_time
176177
.with_label_values(&["record_progress"])
177178
.observe(start.elapsed().as_secs_f64());
179+
data.metrics
180+
.crater_endpoint_time
181+
.with_label_values(&["record_progress_lock"])
182+
.observe(lock_wait.as_secs_f64());
178183
ret
179184
}
180185

0 commit comments

Comments
 (0)