From c35fbff05205330ab8e49f6008fdbd59128cee14 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 18 Aug 2021 16:13:49 +0300 Subject: Add prometheus metrics for the jobs, update tests Signed-off-by: Valery Piashchynski --- plugins/jobs/drivers/beanstalk/consumer.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/jobs/drivers/beanstalk/consumer.go') diff --git a/plugins/jobs/drivers/beanstalk/consumer.go b/plugins/jobs/drivers/beanstalk/consumer.go index 6a178dff..6323148b 100644 --- a/plugins/jobs/drivers/beanstalk/consumer.go +++ b/plugins/jobs/drivers/beanstalk/consumer.go @@ -235,6 +235,7 @@ func (j *JobConsumer) State(ctx context.Context) (*jobState.State, error) { Pipeline: pipe.Name(), Driver: pipe.Driver(), Queue: j.tName, + Ready: ready(atomic.LoadUint32(&j.listeners)), } // set stat, skip errors (replace with 0) @@ -353,3 +354,7 @@ func (j *JobConsumer) Resume(_ context.Context, p string) { Start: time.Now(), }) } + +func ready(r uint32) bool { + return r > 0 +} -- cgit v1.2.3