Add available RAM to statsd
If the executor is using it to decide whether to accept jobs, we should graph it. Change-Id: If34e81f953df4ed0a2c2c287e7d00d4977267fef
This commit is contained in:
parent
1754b2caf0
commit
40ca3791fb
|
@ -146,6 +146,12 @@ These metrics are emitted by the Zuul :ref:`scheduler`:
|
||||||
|
|
||||||
The one-minute load average of this executor, multiplied by 100.
|
The one-minute load average of this executor, multiplied by 100.
|
||||||
|
|
||||||
|
.. stat:: pct_available_ram
|
||||||
|
:type: gauge
|
||||||
|
|
||||||
|
The available RAM (including buffers and cache) on this
|
||||||
|
executor, as a percentage multiplied by 100.
|
||||||
|
|
||||||
.. stat:: zuul.nodepool
|
.. stat:: zuul.nodepool
|
||||||
|
|
||||||
Holds metrics related to Zuul requests from Nodepool.
|
Holds metrics related to Zuul requests from Nodepool.
|
||||||
|
|
|
@ -1795,6 +1795,7 @@ class ExecutorServer(object):
|
||||||
if self.statsd:
|
if self.statsd:
|
||||||
base_key = 'zuul.executor.%s' % self.hostname
|
base_key = 'zuul.executor.%s' % self.hostname
|
||||||
self.statsd.gauge(base_key + '.load_average', 0)
|
self.statsd.gauge(base_key + '.load_average', 0)
|
||||||
|
self.statsd.gauge(base_key + '.pct_available_ram', 0)
|
||||||
self.statsd.gauge(base_key + '.running_builds', 0)
|
self.statsd.gauge(base_key + '.running_builds', 0)
|
||||||
|
|
||||||
self.log.debug("Stopped")
|
self.log.debug("Stopped")
|
||||||
|
@ -1976,6 +1977,8 @@ class ExecutorServer(object):
|
||||||
base_key = 'zuul.executor.%s' % self.hostname
|
base_key = 'zuul.executor.%s' % self.hostname
|
||||||
self.statsd.gauge(base_key + '.load_average',
|
self.statsd.gauge(base_key + '.load_average',
|
||||||
int(load_avg * 100))
|
int(load_avg * 100))
|
||||||
|
self.statsd.gauge(base_key + '.pct_available_ram',
|
||||||
|
int(avail_mem_pct * 100))
|
||||||
self.statsd.gauge(base_key + '.running_builds',
|
self.statsd.gauge(base_key + '.running_builds',
|
||||||
len(self.job_workers))
|
len(self.job_workers))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue