diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-16 04:10:24 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-16 04:10:24 +0200 |
| commit | c54fb8bceee0341deb973cc06a73c199786832bf (patch) | |
| tree | 0804e29a9b91fa8513eca6e4228eb6729a2125c1 /internal/lsp/server.go | |
| parent | 07e285f1bb28c832a78de123392be80fcd0c79b2 (diff) | |
Use atomic.Int64 for LLM stats counters instead of server-wide mutex
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/lsp/server.go')
| -rw-r--r-- | internal/lsp/server.go | 10 |
1 files changed, 5 insertions, 5 deletions
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 |
