Skip to content

Commit 23710bd

Browse files
committed
fix: use TotalSeconds for operation latency measurement in SloContext
1 parent 34db579 commit 23710bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

slo/src/Internal/SloContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ Task ShootingTask(RateLimiter rateLimitPolicy, string operationType,
233233
{
234234
errorsTotal.WithLabels(statusCode.StatusName()).Inc();
235235
operationsFailureTotal.Inc();
236-
operationLatencySeconds.WithLabels("err").Observe(sw.ElapsedMilliseconds / 1000);
236+
operationLatencySeconds.WithLabels("err").Observe(sw.Elapsed.TotalSeconds);
237237
}
238238
else
239239
{
240240
operationsSuccessTotal.Inc();
241-
operationLatencySeconds.WithLabels("success").Observe(sw.ElapsedMilliseconds / 1000);
241+
operationLatencySeconds.WithLabels("success").Observe(sw.Elapsed.TotalSeconds);
242242
}
243243
}, cancellationTokenSource.Token);
244244
}

0 commit comments

Comments
 (0)