[feature] add metrics for worker counts, and worker queue sizes (#4387)

should help to debug https://codeberg.org/superseriousbusiness/gotosocial/issues/4309

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4387
Reviewed-by: Daenney <daenney@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
kim 2025-08-20 18:14:00 +02:00 committed by kim
commit 1144ac037f
6 changed files with 169 additions and 10 deletions

View file

@ -110,6 +110,11 @@ func (p *WorkerPool) Stop() {
p.workers = p.workers[:0]
}
// Len returns number of currently active workers.
func (p *WorkerPool) Len() int {
return len(p.workers)
}
// Worker wraps an httpclient.Client{} to feed
// from queue.StructQueue{} for ActivityPub reqs
// to deliver. It does so while prioritizing new