From f2af716be043a2bb17a2580ed212200515da9ad0 Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Tue, 30 Jul 2019 14:43:50 +0200 Subject: Trending: Reduce input data Change-Id: Ibc2c1f02c80189045a63cf07e89c6a409d785047 Signed-off-by: Tibor Frank --- resources/tools/presentation/input_data_parser.py | 71 +++++++++++------------ 1 file changed, 35 insertions(+), 36 deletions(-) (limited to 'resources') 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 -- cgit 1.2.3-korg