Commit d31ed108 authored by Jameson Rollins's avatar Jameson Rollins

daemon: tweak loop timing diagnostics

clarify int microseconds.
parent 0478c9e6
......@@ -389,7 +389,7 @@ guardian version: {}
########################################
while True:
self['MAINTIME'] = (time.time() - loopstart)*1000000
self['MAINUSEC'] = int((time.time() - loopstart)*1000000)
# FIXME: this would be the best place to call this, as this should
# only need to be called once to update all the values pushed during
......@@ -423,8 +423,9 @@ guardian version: {}
time.sleep(0.001)
self.log.log(5, '====== start cycle ======')
self['LOOPTIME'] = (time.time() - loopstart)*1000000
looplast = loopstart
loopstart = time.time()
self['LOOPUSEC'] = int((loopstart - looplast)*1000000)
sd_notify("WATCHDOG=1")
########################################
......
......@@ -135,14 +135,12 @@ guarddb = {
'hihi': const.CPS,
'log_changes': False,
},
'LOOPTIME': {
'type': 'float',
'unit': 'seconds',
'LOOPUSEC': {
'type': 'int',
'log_changes': False,
},
'MAINTIME': {
'type': 'float',
'unit': 'seconds',
'MAINUSEC': {
'type': 'int',
'log_changes': False,
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment