diff options
Diffstat (limited to 'yardstick/benchmark/core/task.py')
-rw-r--r-- | yardstick/benchmark/core/task.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py index ede14b1c0..b2da7a2ee 100644 --- a/yardstick/benchmark/core/task.py +++ b/yardstick/benchmark/core/task.py @@ -48,6 +48,12 @@ class Task(object): # pragma: no cover self.contexts = [] self.outputs = {} + def _set_dispatchers(self, output_config): + dispatchers = output_config.get('DEFAULT', {}).get('dispatcher', + 'file') + out_types = [s.strip() for s in dispatchers.split(',')] + output_config['DEFAULT']['dispatcher'] = out_types + def start(self, args, **kwargs): """Start a benchmark scenario.""" @@ -68,7 +74,10 @@ class Task(object): # pragma: no cover self._set_output_config(output_config, args.output_file) LOG.debug('Output configuration is: %s', output_config) - if output_config['DEFAULT'].get('dispatcher') == 'file': + self._set_dispatchers(output_config) + + # update dispatcher list + if 'file' in output_config['DEFAULT']['dispatcher']: result = {'status': 0, 'result': {}} utils.write_json_to_file(args.output_file, result) @@ -198,9 +207,10 @@ class Task(object): # pragma: no cover return 'PASS' def _do_output(self, output_config, result): + dispatchers = DispatcherBase.get(output_config) - dispatcher = DispatcherBase.get(output_config) - dispatcher.flush_result_data(result) + for dispatcher in dispatchers: + dispatcher.flush_result_data(result) def _run(self, scenarios, run_in_parallel, output_file): """Deploys context and calls runners""" |