Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable master stats for tests #53822

Merged
merged 1 commit into from
Jul 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion salt/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import copy
import ctypes
import functools
import pprint
import os
import re
import sys
Expand Down Expand Up @@ -1073,9 +1074,11 @@ def _post_stats(self, start, cmd):
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):
'''
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/files/conf/master
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,5 @@ peer_run:
- vault.generate_token
sdbvault:
driver: vault

master_stats: true