From 4189dbd95283726014cec8e8917302574fcddb08 Mon Sep 17 00:00:00 2001 From: Tim Holm Date: Fri, 22 Nov 2024 10:24:02 +1100 Subject: [PATCH] fix: correct worker count for services --- pkg/collector/service.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/collector/service.go b/pkg/collector/service.go index 4d36fee4..061505fc 100644 --- a/pkg/collector/service.go +++ b/pkg/collector/service.go @@ -108,9 +108,15 @@ func (s *ServiceRequirements) HasDatabases() bool { func (s *ServiceRequirements) WorkerCount() int { workerCount := len(lo.Values(s.routes)) + len(s.listeners) + - len(s.schedules) + - len(lo.Values(s.subscriptions)) + - len(lo.Values(s.websockets)) + len(s.schedules) + + for _, sub := range s.subscriptions { + workerCount += len(sub) + } + + for _, ws := range s.websockets { + workerCount += len(ws) + } if s.proxy != nil { workerCount++