From b98a34ad49d6e8bf2c21f9a3006d2f5f206189fd Mon Sep 17 00:00:00 2001 From: Rafael Folco Date: Tue, 12 Nov 2024 09:25:14 -0300 Subject: [PATCH] Record single metric sample value zero This results in incorrectly generated post-processing metric files. Only skip it as non-existent for throughput class. --- python/toolbox/metrics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/toolbox/metrics.py b/python/toolbox/metrics.py index 8065ee4..a107d5b 100644 --- a/python/toolbox/metrics.py +++ b/python/toolbox/metrics.py @@ -174,7 +174,8 @@ def finish_samples(): # All of the stored samples need to be written for idx in range(0, len(stored_sample)): if file_id in metric_data_fh.keys(): - if stored_sample[idx]['value'] == 0 and idx not in num_written_samples.keys(): + if (stored_sample[idx]['value'] == 0 and idx not in num_written_samples.keys() and + and metric_types[idx]['desc']['class'] == "throughput"): # This metric has only 1 sample and the value is 0, so it "did not do any work". Therefore, we can just # not create this metric at all. # TODO: This optimization might be better if the metric source/type could opt in/out of this.