From be5bd15dad2fb849b8c7358a87ed04f86b861730 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 1 Jan 2026 18:39:30 -0600 Subject: report decision stats in finally --- src/slskd/Application.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index f5a15be1..df01206f 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -803,6 +803,16 @@ namespace slskd } finally { + if (decisionStopwatch.IsRunning) + { + decisionStopwatch.Stop(); + } + + // decision latency is reported here so that we can track both successes and failures; they do the same + // work so lumping them together gives us the clearest picture + Metrics.Enqueue.DecisionLatency.Observe(decisionStopwatch.ElapsedMilliseconds); + Metrics.Enqueue.CurrentDecisionLatency.Update(decisionStopwatch.ElapsedMilliseconds); + if (userSemaphoreAcquired) { userSemaphore.Release(); -- cgit v1.2.3