diff --git a/benchmarks/result_analyzer.py b/benchmarks/result_analyzer.py index 1a7ca10d808..69f6b323206 100644 --- a/benchmarks/result_analyzer.py +++ b/benchmarks/result_analyzer.py @@ -157,7 +157,8 @@ def extract_metrics_jsonl(self, file: str): if "error" not in dataline["metrics"]: d["dimensions"]["run_status"] = "success" - d["metrics"] = self.get_calculated_metrics(d["metrics"], dataline) + if len(dataline["metrics"]) > 0: + d["metrics"] = self.get_calculated_metrics(d["metrics"], dataline) else: d["dimensions"]["run_status"] = "failure" d["metrics"]["median_total_time"] = -1 @@ -216,7 +217,7 @@ def extract_metrics_csv(self, file: str, metric_df: Optional[pd.DataFrame]): if "error" in dataline["metrics"] and not self._args.hide_errors: d["error_message"] = dataline["metrics"]["error"] - if "error" not in dataline["metrics"]: + if len(dataline["metrics"]) > 0 and "error" not in dataline["metrics"]: d = self.get_calculated_metrics(d, dataline) new_row = pd.Series(d)