Skip to content

Commit

Permalink
switch to microseconds for remote execution metric (#11464)
Browse files Browse the repository at this point in the history
Switch to microseconds for the metric for remote execution time to first response. This will provide better resolution, and should be switched now before this metric is ever documented or exposed anywhere.
  • Loading branch information
Tom Dyas authored Jan 15, 2021
1 parent a6a4fa4 commit 2dc94ca
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/rust/engine/process_execution/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,14 @@ impl CommandRunner {
let item = stream.next().await;

if let Some(start_time) = start_time_opt.take() {
let timing: Result<i64, _> = Instant::now()
let timing: Result<u64, _> = Instant::now()
.duration_since(start_time)
.as_millis()
.as_micros()
.try_into();
if let Ok(obs) = timing {
context.workunit_store.record_observation(
ObservationMetric::RemoteExecutionRPCFirstResponseTime,
obs as u64,
);
context
.workunit_store
.record_observation(ObservationMetric::RemoteExecutionRPCFirstResponseTime, obs);
}
}

Expand Down

0 comments on commit 2dc94ca

Please sign in to comment.