MCPcopy Create free account
hub / github.com/PostHog/duckgres / WorkerCount

Method WorkerCount

controlplane/org_reserved_pool.go:296–300  ·  view source on GitHub ↗

WorkerCount returns the number of workers this CP currently has assigned to the org that count against MaxWorkers (hot-idle workers are excluded — they're parked for reclaim and don't consume the cap budget, same as atOrgWorkerCap). This is the per-CP local view; the admin layer sums it across repli

()

Source from the content-addressed store, hash-verified

294// count budget), so a true result means every counted worker is actively
295// assigned — a new worker cannot be added.
296func (p *OrgReservedPool) atOrgWorkerCap() bool {
297 p.shared.mu.Lock()
298 defer p.shared.mu.Unlock()
299 return p.maxWorkers > 0 && p.assignedWorkerCountLocked() >= p.maxWorkers
300}
301
302// WorkerCount returns the number of workers this CP currently has assigned to
303// the org that count against MaxWorkers (hot-idle workers are excluded — they're

Callers 2

AllOrgStatsMethod · 0.80

Calls 1

Tested by 1