summaryrefslogtreecommitdiff
path: root/plugins/jobs/drivers/beanstalk
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-08-18 16:13:49 +0300
committerValery Piashchynski <[email protected]>2021-08-18 16:13:49 +0300
commitc35fbff05205330ab8e49f6008fdbd59128cee14 (patch)
treed3eb03e8db7231d97ae4ff1d60a0c5a50db8a6fb /plugins/jobs/drivers/beanstalk
parent1d092e57afb55a01283b41942ca3ef15a7e4bdef (diff)
Add prometheus metrics for the jobs, update tests
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/drivers/beanstalk')
-rw-r--r--plugins/jobs/drivers/beanstalk/consumer.go5
1 files changed, 5 insertions, 0 deletions
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
+}