From 6f87895267f9c959eeebefaf1129331fdc31f455 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 26 Sep 2023 15:55:52 +0200 Subject: [PATCH] driver.mld: Fail metrics collection if a command hasn't run This aborts some obviously broken metric collections. This situation happens when a dependency is missing or if only some blocks have failed. --- doc/driver.mld | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/driver.mld b/doc/driver.mld index bb16937170..012622ba48 100644 --- a/doc/driver.mld +++ b/doc/driver.mld @@ -813,7 +813,7 @@ let compute_metric_cmd cmd = compute (min min_ hd.time) (max max_ hd.time) (total +. hd.time) (count + 1) tl in match filter_commands cmd with - | [] -> [] + | [] -> failwith ("No commands run for " ^ cmd) | hd :: tl -> let min, max, avg, count = compute hd.time hd.time hd.time 1 tl in [ @@ -854,7 +854,7 @@ let compute_produced_cmd cmd = compute (min min_ size) (max max_ size) (total +. float size) (count + 1) tl in match List.filter_map output_file_size (filter_commands cmd) with - | [] -> [] + | [] -> failwith ("No commands run for " ^ cmd) | size0 :: tl -> let min, max, avg, count = compute size0 size0 (float size0) 1 tl in [