diff options
author | Hou Jingwen <houjingwen@huawei.com> | 2015-09-15 06:39:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2015-09-15 06:39:37 +0000 |
commit | 2aa1cd3922f26b9d8c9bdad310463caa5eeb8136 (patch) | |
tree | c1b493ad1ee9b9504cceff0fb28d01933e6a1b62 /yardstick/benchmark/runners/base.py | |
parent | d4cfd8c43bd7c00ab07123d7886fc95f0a2ce6cc (diff) | |
parent | 84ab6e07ef9abef13b44b69d41d5886a253751de (diff) |
Merge "Add test result dispatcher"
Diffstat (limited to 'yardstick/benchmark/runners/base.py')
-rw-r--r-- | yardstick/benchmark/runners/base.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/yardstick/benchmark/runners/base.py b/yardstick/benchmark/runners/base.py index 30fa07639..848322679 100644 --- a/yardstick/benchmark/runners/base.py +++ b/yardstick/benchmark/runners/base.py @@ -8,7 +8,6 @@ ############################################################################## import importlib -import json import logging import multiprocessing import subprocess @@ -18,6 +17,7 @@ log = logging.getLogger(__name__) import yardstick.common.utils as utils from yardstick.benchmark.scenarios import base as base_scenario +from yardstick.dispatcher.base import Base as DispatcherBase def _output_serializer_main(filename, queue): @@ -25,16 +25,18 @@ def _output_serializer_main(filename, queue): Use of this process enables multiple instances of a scenario without messing up the output file. ''' - with open(filename, 'a+') as outfile: - while True: - # blocks until data becomes available - record = queue.get() - if record == '_TERMINATE_': - outfile.close() - break - else: - json.dump(record, outfile) - outfile.write('\n') + config = {} + config["type"] = "File" + config["file_path"] = filename + dispatcher = DispatcherBase.get(config) + + while True: + # blocks until data becomes available + record = queue.get() + if record == '_TERMINATE_': + break + else: + dispatcher.record_result_data(record) def _single_action(seconds, command, queue): |