Enable master stats for tests

This commit is contained in:
Daniel A. Wozniak 2019-07-11 16:26:13 -07:00
parent 1756156aee
commit d2b8315001
No known key found for this signature in database
GPG key ID: 166B9D2C06C82D61
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,7 @@ from __future__ import absolute_import, with_statement, print_function, unicode_
import copy
import ctypes
import functools
import pprint
import os
import re
import sys
@ -1073,9 +1074,11 @@ class MWorker(salt.utils.process.SignalHandlingMultiprocessingProcess):
self.stats[cmd]['mean'] = (self.stats[cmd]['mean'] * (self.stats[cmd]['runs'] - 1) + duration) / self.stats[cmd]['runs']
if end - self.stat_clock > self.opts['master_stats_event_iter']:
# Fire the event with the stats and wipe the tracker
self.aes_funcs.event.fire_event({'time': end - self.stat_clock, 'worker': self.name, 'stats': self.stats}, tagify(self.name, 'stats'))
stats_last = {'time': end - self.stat_clock, 'worker': self.name, 'stats': self.stats}
self.aes_funcs.event.fire_event(stats_last, tagify(self.name, 'stats'))
self.stats = collections.defaultdict(lambda: {'mean': 0, 'runs': 0})
self.stat_clock = end
log.error("STATS %s", pprint.pformat(stats_last))
def _handle_clear(self, load):
'''

View file

@ -128,3 +128,5 @@ peer_run:
- vault.generate_token
sdbvault:
driver: vault
master_stats: true