From c54fb8bceee0341deb973cc06a73c199786832bf Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 16 Mar 2026 04:10:24 +0200 Subject: Use atomic.Int64 for LLM stats counters instead of server-wide mutex Co-Authored-By: Claude Opus 4.6 --- internal/lsp/server.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/lsp/server.go') diff --git a/internal/lsp/server.go b/internal/lsp/server.go index d8fdc92..3af7e1d 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -38,11 +38,11 @@ type Server struct { cfg appconfig.App codeActionSubsystem chatSubsystem - // LLM request stats - llmReqTotal int64 - llmSentBytesTotal int64 - llmRespTotal int64 - llmRespBytesTotal int64 + // LLM request stats — atomic to avoid taking the server-wide mu lock. + llmReqTotal atomic.Int64 + llmSentBytesTotal atomic.Int64 + llmRespTotal atomic.Int64 + llmRespBytesTotal atomic.Int64 startTime time.Time completionSubsystem configLoadOpts appconfig.LoadOptions -- cgit v1.2.3