@@ -12,6 +12,7 @@ type collector struct {
1212 versionInfo * prometheus.Desc
1313 statusJobs * prometheus.Desc
1414 statusJobsRunning * prometheus.Desc
15+ statusJobsWaiting * prometheus.Desc
1516 statusWorkers * prometheus.Desc
1617}
1718
@@ -31,6 +32,7 @@ func (e *Exporter) newCollector(g *gearman) *collector {
3132 versionInfo : newFuncMetric ("version_info" , "gearman version" , []string {"version" }),
3233 statusJobs : newFuncMetric ("jobs" , "number of jobs queued or running" , []string {"function" }),
3334 statusJobsRunning : newFuncMetric ("jobs_running" , "number of running jobs" , []string {"function" }),
35+ statusJobsWaiting : newFuncMetric ("jobs_waiting" , "number of jobs waiting for an available worker" , []string {"function" }),
3436 statusWorkers : newFuncMetric ("workers" , "number of capable workers" , []string {"function" }),
3537 }
3638}
@@ -40,6 +42,7 @@ func (c *collector) Describe(ch chan<- *prometheus.Desc) {
4042 ch <- c .versionInfo
4143 ch <- c .statusJobs
4244 ch <- c .statusJobsRunning
45+ ch <- c .statusJobsWaiting
4346 ch <- c .statusWorkers
4447}
4548
@@ -82,6 +85,12 @@ func (c *collector) collectStatus(ch chan<- prometheus.Metric) {
8285 float64 (v .running ),
8386 k )
8487
88+ ch <- prometheus .MustNewConstMetric (
89+ c .statusJobsWaiting ,
90+ prometheus .GaugeValue ,
91+ float64 (v .total - v .running ),
92+ k )
93+
8594 ch <- prometheus .MustNewConstMetric (
8695 c .statusWorkers ,
8796 prometheus .GaugeValue ,
0 commit comments