File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ To modify test parameters, provide environment variables:
103103- ` KEYS_PER_BLOCK ` : Number of keys per block
104104- ` VALUE_SIZE ` : Size of each value in bytes
105105- ` WARMUP_BLOCKS ` : Number of blocks to warmup with
106+ - ` BENCHMARKS ` : Comma-separated list of benchmarks to run
106107
107108## Troubleshooting
108109
Original file line number Diff line number Diff line change @@ -52,6 +52,25 @@ let all_benchmarks () =
5252 ; test ~name: " multi_file_read" (module Multi_file_db ) make_read_bench
5353 ]
5454
55+ (* Filter benchmarks based on BENCHMARKS environment variable *)
56+ let filter_benchmarks benchmarks =
57+ match Sys. getenv " BENCHMARKS" with
58+ | None ->
59+ benchmarks
60+ | Some names_str ->
61+ let requested_names =
62+ String. split names_str ~on: ','
63+ |> List. map ~f: String. strip |> String.Set. of_list
64+ in
65+ let filtered =
66+ List. filter benchmarks ~f: (fun bench ->
67+ String.Set. mem requested_names (Bench.Test. name bench) )
68+ in
69+ Printf. printf " Filtering benchmarks: running %d of %d\n "
70+ (List. length filtered) (List. length benchmarks) ;
71+ Printf. printf " Requested: %s\n " names_str ;
72+ filtered
73+
5574(* Main entry point *)
5675let () =
5776 (* Print configuration *)
@@ -65,4 +84,5 @@ let () =
6584 Printf. printf " \n " ;
6685
6786 (* Run benchmarks *)
68- Command. run (Bench. make_command (all_benchmarks () ))
87+ let benchmarks = all_benchmarks () |> filter_benchmarks in
88+ Command. run (Bench. make_command benchmarks)
You can’t perform that action at this time.
0 commit comments