mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-03 14:18:42 +00:00
Exposing waiting job count as metric
This commit is contained in:
parent
ca67aff5f9
commit
f0c641fa9d
1 changed files with 6 additions and 0 deletions
|
@ -207,6 +207,11 @@ func setupMetrics(g *errgroup.Group, store_ store.Store) {
|
||||||
Name: "pending_jobs",
|
Name: "pending_jobs",
|
||||||
Help: "Total number of pending build processes.",
|
Help: "Total number of pending build processes.",
|
||||||
})
|
})
|
||||||
|
waitingJobs := promauto.NewGauge(prometheus.GaugeOpts{
|
||||||
|
Namespace: "drone",
|
||||||
|
Name: "waiting_jobs",
|
||||||
|
Help: "Total number of builds waiting on deps.",
|
||||||
|
})
|
||||||
runningJobs := promauto.NewGauge(prometheus.GaugeOpts{
|
runningJobs := promauto.NewGauge(prometheus.GaugeOpts{
|
||||||
Namespace: "drone",
|
Namespace: "drone",
|
||||||
Name: "running_jobs",
|
Name: "running_jobs",
|
||||||
|
@ -237,6 +242,7 @@ func setupMetrics(g *errgroup.Group, store_ store.Store) {
|
||||||
for {
|
for {
|
||||||
stats := droneserver.Config.Services.Queue.Info(nil)
|
stats := droneserver.Config.Services.Queue.Info(nil)
|
||||||
pendingJobs.Set(float64(stats.Stats.Pending))
|
pendingJobs.Set(float64(stats.Stats.Pending))
|
||||||
|
waitingJobs.Set(float64(stats.Stats.WaitingOnDeps))
|
||||||
runningJobs.Set(float64(stats.Stats.Running))
|
runningJobs.Set(float64(stats.Stats.Running))
|
||||||
workers.Set(float64(stats.Stats.Workers))
|
workers.Set(float64(stats.Stats.Workers))
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
|
|
Loading…
Reference in a new issue