@@ -98,14 +98,25 @@ public static void main(String[] args) throws IOException {
9898
9999 logger .info ("Heap space available is {}" , Runtime .getRuntime ().maxMemory ());
100100
101- // Filter out --output and its argument from the args
101+ // Filter out --output, --config and their arguments from the args
102102 String finalOutputPath = outputPath ;
103+ String configPath = null ;
104+ for (int i = 0 ; i < args .length - 1 ; i ++) {
105+ if (args [i ].equals ("--config" )) configPath = args [i +1 ];
106+ }
107+ String finalConfigPath = configPath ;
103108 String [] filteredArgs = Arrays .stream (args )
104- .filter (arg -> !arg .equals ("--output" ) && !arg .equals (finalOutputPath ))
109+ .filter (arg -> !arg .equals ("--output" ) && !arg .equals (finalOutputPath ) &&
110+ !arg .equals ("--config" ) && !arg .equals (finalConfigPath ))
105111 .toArray (String []::new );
106112
113+ // Log the filtered arguments for debugging
114+ logger .info ("Filtered arguments: {}" , Arrays .toString (filteredArgs ));
115+
107116 // generate a regex that matches any regex in filteredArgs, or if filteredArgs is empty/null, match everything
108117 var regex = filteredArgs .length == 0 ? ".*" : Arrays .stream (filteredArgs ).flatMap (s -> Arrays .stream (s .split ("\\ s" ))).map (s -> "(?:" + s + ")" ).collect (Collectors .joining ("|" ));
118+ logger .info ("Generated regex pattern: {}" , regex );
119+
109120 // compile regex and do substring matching using find
110121 var pattern = Pattern .compile (regex );
111122
@@ -125,7 +136,7 @@ public static void main(String[] args) throws IOException {
125136 if (datasetName .endsWith (".hdf5" )) {
126137 datasetName = datasetName .substring (0 , datasetName .length () - ".hdf5" .length ());
127138 }
128-
139+
129140 MultiConfig config = MultiConfig .getDefaultConfig ("autoDefault" );
130141 config .dataset = datasetName ;
131142 logger .info ("Using configuration: {}" , config );
@@ -140,7 +151,7 @@ public static void main(String[] args) throws IOException {
140151 config .search .getCompressorParameters (),
141152 config .search .topKOverquery ,
142153 config .search .useSearchPruning ));
143-
154+
144155 logger .info ("Benchmark completed for dataset: {}" , datasetName );
145156 } catch (Exception e ) {
146157 logger .error ("Exception while processing dataset {}" , datasetName , e );
@@ -159,20 +170,20 @@ public static void main(String[] args) throws IOException {
159170 mapper .writerWithDefaultPrettyPrinter ().writeValue (detailsFile , results );
160171
161172 File outputFile = new File (outputPath + ".csv" );
162-
173+
163174 // Get summary statistics by dataset
164175 Map <String , SummaryStats > statsByDataset = BenchmarkSummarizer .summarizeByDataset (results );
165-
176+
166177 // Write CSV data
167178 try (FileWriter writer = new FileWriter (outputFile )) {
168179 // Write CSV header
169180 writer .write ("dataset,QPS,Mean Latency,Recall@10\n " );
170-
181+
171182 // Write one row per dataset with average metrics
172183 for (Map .Entry <String , SummaryStats > entry : statsByDataset .entrySet ()) {
173184 String dataset = entry .getKey ();
174185 SummaryStats datasetStats = entry .getValue ();
175-
186+
176187 writer .write (dataset + "," );
177188 writer .write (datasetStats .getAvgQps () + "," );
178189 writer .write (datasetStats .getAvgLatency () + "," );
0 commit comments