diff options
author | Tibor Frank <tifrank@cisco.com> | 2019-07-30 14:43:50 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2019-07-30 14:43:50 +0200 |
commit | f2af716be043a2bb17a2580ed212200515da9ad0 (patch) | |
tree | fedf61170ce066603a4b700064a98b4c28d28327 /resources/tools/presentation/input_data_parser.py | |
parent | 52ebb67e52800f4240001d117d56d08d78a84d6a (diff) |
Trending: Reduce input data
Change-Id: Ibc2c1f02c80189045a63cf07e89c6a409d785047
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/input_data_parser.py')
-rw-r--r-- | resources/tools/presentation/input_data_parser.py | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py index 6da428e1bb..20974f1f05 100644 --- a/resources/tools/presentation/input_data_parser.py +++ b/resources/tools/presentation/input_data_parser.py @@ -1333,45 +1333,44 @@ class InputData(object): for build in builds: work_queue.put((job, build, repeat)) - work_queue.join() + work_queue.join() - logging.info("Done.") - - logging.info("Collecting data:") - - while not data_queue.empty(): - - try: - result = data_queue.get() - - job = result["job"] - build_nr = result["build"]["build"] + logging.info("Done.") - logging.info(" {job}-{build}".format(job=job, build=build_nr)) - - if result["data"]: - data = result["data"] - build_data = pd.Series({ - "metadata": pd.Series(data["metadata"].values(), - index=data["metadata"].keys()), - "suites": pd.Series(data["suites"].values(), - index=data["suites"].keys()), - "tests": pd.Series(data["tests"].values(), - index=data["tests"].keys())}) - - if self._input_data.get(job, None) is None: - self._input_data[job] = pd.Series() - self._input_data[job][str(build_nr)] = build_data - - self._cfg.set_input_file_name(job, build_nr, - result["build"]["file-name"]) - - self._cfg.set_input_state(job, build_nr, result["state"]) - - except (MemoryError, EOFError) as err: - logging.error(repr(err)) - raise + logging.info("Collecting data:") + while not data_queue.empty(): + try: + result = data_queue.get() + + job = result["job"] + build_nr = result["build"]["build"] + + logging.info(" {job}-{build}".format(job=job, + build=build_nr)) + if result["data"]: + data = result["data"] + build_data = pd.Series({ + "metadata": pd.Series( + data["metadata"].values(), + index=data["metadata"].keys()), + "suites": pd.Series(data["suites"].values(), + index=data["suites"].keys()), + "tests": pd.Series(data["tests"].values(), + index=data["tests"].keys())}) + + if self._input_data.get(job, None) is None: + self._input_data[job] = pd.Series() + self._input_data[job][str(build_nr)] = build_data + + self._cfg.set_input_file_name( + job, build_nr, result["build"]["file-name"]) + + self._cfg.set_input_state(job, build_nr, result["state"]) + + except (MemoryError, EOFError) as err: + logging.error(repr(err)) + raise del data_queue |