Browse Source

Add available RAM to statsd

If the executor is using it to decide whether to accept jobs, we
should graph it.

Change-Id: If34e81f953df4ed0a2c2c287e7d00d4977267fef
changes/07/539707/1
James E. Blair 4 years ago
parent
commit
40ca3791fb
  1. 6
      doc/source/admin/monitoring.rst
  2. 3
      zuul/executor/server.py

6
doc/source/admin/monitoring.rst

@ -146,6 +146,12 @@ These metrics are emitted by the Zuul :ref:`scheduler`:
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
Holds metrics related to Zuul requests from Nodepool.

3
zuul/executor/server.py

@ -1795,6 +1795,7 @@ class ExecutorServer(object):
if self.statsd:
base_key = 'zuul.executor.%s' % self.hostname
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.log.debug("Stopped")
@ -1976,6 +1977,8 @@ class ExecutorServer(object):
base_key = 'zuul.executor.%s' % self.hostname
self.statsd.gauge(base_key + '.load_average',
int(load_avg * 100))
self.statsd.gauge(base_key + '.pct_available_ram',
int(avail_mem_pct * 100))
self.statsd.gauge(base_key + '.running_builds',
len(self.job_workers))

Loading…
Cancel
Save