Skip to content

Commit

Permalink
IMPROVEMENT:: ADD TIMESTAMP TO MANAGER STATS (#208)
Browse files Browse the repository at this point in the history
- add RFC3339 'timestamp' field to stats generated from manager.py
  • Loading branch information
frikilax authored Jan 27, 2021
1 parent a844a1a commit c846254
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion manager/Administration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
__email__ = "[email protected]"
__doc__ = 'The unix socket administration server class'

import datetime
import socket
import logging
import redis
Expand Down Expand Up @@ -188,7 +189,9 @@ def report_stats(self, services, reports_conf, cv):
if not self._continue:
logger.debug("Reporter: stopping")
break
stats = json.dumps(services.monitor_all())
jsonStats = services.monitor_all()
jsonStats['timestamp'] = datetime.datetime.utcnow().strftime("%FT%TZ")
stats = json.dumps(jsonStats)
logger.debug("reporting stats: {}".format(stats))

if self._stats_redis:
Expand Down

0 comments on commit c846254

Please sign in to comment.