From 40ca3791fbfd25cb9610b3f3ec2e4c10fdb8239a Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 31 Jan 2018 14:22:07 -0800 Subject: [PATCH] Add available RAM to statsd If the executor is using it to decide whether to accept jobs, we should graph it. Change-Id: If34e81f953df4ed0a2c2c287e7d00d4977267fef --- doc/source/admin/monitoring.rst | 6 ++++++ zuul/executor/server.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/doc/source/admin/monitoring.rst b/doc/source/admin/monitoring.rst index e6e6139878..81275f3518 100644 --- a/doc/source/admin/monitoring.rst +++ b/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. diff --git a/zuul/executor/server.py b/zuul/executor/server.py index 1c72275b55..f0a7e0e36a 100644 --- a/zuul/executor/server.py +++ b/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))