mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #53822 from dwoz/master_stats_test
Enable master stats for tests
This commit is contained in:
commit
ba33d76148
2 changed files with 6 additions and 1 deletions
|
@ -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):
|
||||
'''
|
||||
|
|
|
@ -128,3 +128,5 @@ peer_run:
|
|||
- vault.generate_token
|
||||
sdbvault:
|
||||
driver: vault
|
||||
|
||||
master_stats: true
|
||||
|
|
Loading…
Add table
Reference in a new issue