Collect and report last reconfigured timestamp
* ms timestamp collected each time Scheduler.reconfigure() completed * last reconfigured timestamp reported through the status.json * it could be useful to determine when zuul conf reloaded Change-Id: I03c5a5734f2127ef40be9ec512c983b136508be7
This commit is contained in:
parent
dda083b9fb
commit
5d0438d45f
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"last_reconfigured": 1389381756000,
|
||||||
"message": "Example error message",
|
"message": "Example error message",
|
||||||
"pipelines": [
|
"pipelines": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"last_reconfigured": 1389381756000,
|
||||||
"pipelines": [
|
"pipelines": [
|
||||||
{
|
{
|
||||||
"name": "check",
|
"name": "check",
|
||||||
|
|
|
@ -132,6 +132,7 @@ class Scheduler(threading.Thread):
|
||||||
self.layout = model.Layout()
|
self.layout = model.Layout()
|
||||||
|
|
||||||
self.zuul_version = zuul_version.version_info.version_string()
|
self.zuul_version = zuul_version.version_info.version_string()
|
||||||
|
self.last_reconfigured = None
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self._stopped = True
|
self._stopped = True
|
||||||
|
@ -445,6 +446,7 @@ class Scheduler(threading.Thread):
|
||||||
self.log.debug("Waiting for reconfiguration")
|
self.log.debug("Waiting for reconfiguration")
|
||||||
event.wait()
|
event.wait()
|
||||||
self.log.debug("Reconfiguration complete")
|
self.log.debug("Reconfiguration complete")
|
||||||
|
self.last_reconfigured = int(time.time())
|
||||||
|
|
||||||
def promote(self, pipeline_name, change_ids):
|
def promote(self, pipeline_name, change_ids):
|
||||||
event = PromoteEvent(pipeline_name, change_ids)
|
event = PromoteEvent(pipeline_name, change_ids)
|
||||||
|
@ -757,6 +759,9 @@ class Scheduler(threading.Thread):
|
||||||
ret += ', queue length: %s' % self.trigger_event_queue.qsize()
|
ret += ', queue length: %s' % self.trigger_event_queue.qsize()
|
||||||
ret += '</p>'
|
ret += '</p>'
|
||||||
|
|
||||||
|
if self.last_reconfigured:
|
||||||
|
ret += '<p>Last reconfigured: %s</p>' % self.last_reconfigured
|
||||||
|
|
||||||
keys = self.layout.pipelines.keys()
|
keys = self.layout.pipelines.keys()
|
||||||
for key in keys:
|
for key in keys:
|
||||||
pipeline = self.layout.pipelines[key]
|
pipeline = self.layout.pipelines[key]
|
||||||
|
@ -788,6 +793,9 @@ class Scheduler(threading.Thread):
|
||||||
data['result_event_queue']['length'] = \
|
data['result_event_queue']['length'] = \
|
||||||
self.result_event_queue.qsize()
|
self.result_event_queue.qsize()
|
||||||
|
|
||||||
|
if self.last_reconfigured:
|
||||||
|
data['last_reconfigured'] = self.last_reconfigured * 1000
|
||||||
|
|
||||||
pipelines = []
|
pipelines = []
|
||||||
data['pipelines'] = pipelines
|
data['pipelines'] = pipelines
|
||||||
keys = self.layout.pipelines.keys()
|
keys = self.layout.pipelines.keys()
|
||||||
|
|
Loading…
Reference in New Issue