mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 10:52:25 -05:00
[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:
parent
3fad524089
commit
1144ac037f
6 changed files with 169 additions and 10 deletions
|
|
@ -96,6 +96,11 @@ func (p *MsgWorkerPool[T]) Stop() {
|
|||
p.workers = p.workers[:0]
|
||||
}
|
||||
|
||||
// Len returns number of currently active workers.
|
||||
func (p *MsgWorkerPool[T]) Len() int {
|
||||
return len(p.workers)
|
||||
}
|
||||
|
||||
// MsgWorker wraps a processing function to
|
||||
// feed from a queue.StructQueue{} for messages
|
||||
// to process. It does so in a single goroutine
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue