Merge "Add event queue sizes to stats reporting"

This commit is contained in:
Zuul 2020-09-16 21:30:37 +00:00 committed by Gerrit Code Review
commit 53562f7979
2 changed files with 31 additions and 0 deletions

View File

@ -361,6 +361,30 @@ These metrics are emitted by the Zuul :ref:`scheduler`:
executor to run on. This should ideally be at zero; persistent executor to run on. This should ideally be at zero; persistent
higher values indicate more executor resources would be useful. higher values indicate more executor resources would be useful.
.. stat:: zuul.scheduler
Holds metrics related to the Zuul scheduler.
.. stat:: eventqueues
Holds metrics about the event queue lengths in the Zuul scheduler.
.. stat:: trigger
:type: gauge
The size of the current trigger event queue.
.. stat:: result
:type: gauge
The size of the current result event queue.
.. stat:: management
:type: gauge
The size of the current management event queue.
.. stat:: zuul.geard .. stat:: zuul.geard
Gearman job distribution statistics. Gearman jobs encompass the Gearman job distribution statistics. Gearman jobs encompass the

View File

@ -461,6 +461,13 @@ class Scheduler(threading.Thread):
self.statsd.gauge('zuul.executors.jobs_running', execute_running) self.statsd.gauge('zuul.executors.jobs_running', execute_running)
self.statsd.gauge('zuul.executors.jobs_queued', execute_queue) self.statsd.gauge('zuul.executors.jobs_queued', execute_queue)
self.statsd.gauge('zuul.scheduler.eventqueues.trigger',
self.trigger_event_queue.qsize())
self.statsd.gauge('zuul.scheduler.eventqueues.result',
self.result_event_queue.qsize())
self.statsd.gauge('zuul.scheduler.eventqueues.management',
self.management_event_queue.qsize())
def addEvent(self, event): def addEvent(self, event):
# Check the event type and put it in the corresponding queue # Check the event type and put it in the corresponding queue
if isinstance(event, TriggerEvent): if isinstance(event, TriggerEvent):