1818package com .oltpbenchmark ;
1919
2020import com .oltpbenchmark .api .BenchmarkModule ;
21- import com .oltpbenchmark .api .collectors .DBParameterCollector ;
22- import com .oltpbenchmark .api .collectors .DBParameterCollectorGen ;
2321import com .oltpbenchmark .api .TransactionType ;
2422import com .oltpbenchmark .api .TransactionTypes ;
2523import com .oltpbenchmark .api .Worker ;
24+ import com .oltpbenchmark .api .collectors .DBParameterCollector ;
25+ import com .oltpbenchmark .api .collectors .DBParameterCollectorGen ;
2626import com .oltpbenchmark .types .DatabaseType ;
2727import com .oltpbenchmark .types .State ;
2828import com .oltpbenchmark .util .*;
@@ -494,31 +494,6 @@ public static void main(String[] args) throws Exception {
494494 runCreator (benchmark );
495495 LOG .info (
496496 "Finished creating new {} database..." , benchmark .getBenchmarkName ().toUpperCase ());
497- =======
498-
499- // Execute Workload
500- if (isBooleanOptionSet (argsLine , "execute" )) {
501- // Bombs away!
502- try {
503-
504- Results r = runWorkload (benchList , intervalMonitor );
505- writeOutputs (initialParams , r , activeTXTypes , argsLine , xmlConfig );
506- writeHistograms (r );
507-
508- if (argsLine .hasOption ("json-histograms" )) {
509- String histogram_json = writeJSONHistograms (r );
510- String fileName = argsLine .getOptionValue ("json-histograms" );
511- FileUtil .writeStringToFile (new File (fileName ), histogram_json );
512- LOG .info ("Histograms JSON Data: " + fileName );
513- }
514- } catch (Throwable ex ) {
515- LOG .error ("Unexpected error when executing benchmarks." , ex );
516- System .exit (1 );
517- }
518-
519- } else {
520- LOG .info ("Skipping benchmark workload execution" );
521- >>>>>>> 0350 9 c0b (log metrics adjustment )
522497 }
523498 } catch (Throwable ex ) {
524499 LOG .error ("Unexpected error when creating benchmark database tables." , ex );
@@ -589,14 +564,15 @@ public static void main(String[] args) throws Exception {
589564 // Bombs away!
590565 try {
591566 DatabaseType dbType = DatabaseType .valueOf (xmlConfig .getString ("type" ).toUpperCase ());
592- String dbUrl = xmlConfig .getString ("url" );
593- String username = xmlConfig .getString ("username" );
594- String password = xmlConfig .getString ("password" );
595- DBParameterCollector collector = DBParameterCollectorGen .getCollector (dbType , dbUrl , username , password );
596- String initialParams = collector .collectMetrics ();
567+ String dbUrl = xmlConfig .getString ("url" );
568+ String username = xmlConfig .getString ("username" );
569+ String password = xmlConfig .getString ("password" );
570+ DBParameterCollector collector =
571+ DBParameterCollectorGen .getCollector (dbType , dbUrl , username , password );
572+ String initialParams = collector .collectMetrics ();
597573
598574 Results r = runWorkload (benchList , monitorInfo );
599- writeOutputs (r , activeTXTypes , argsLine , xmlConfig );
575+ writeOutputs (initialParams , r , activeTXTypes , argsLine , xmlConfig );
600576 writeHistograms (r );
601577
602578 if (argsLine .hasOption ("json-histograms" )) {
@@ -779,9 +755,10 @@ private static void writeOutputs(
779755
780756 if (rw .hasMetrics ()) {
781757 String initialMetricsFileName = baseFileName + ".initial.metrics.json" ;
782- try (PrintStream ps = new PrintStream (FileUtil .joinPath (outputDirectory , initialMetricsFileName ))) {
758+ try (PrintStream ps =
759+ new PrintStream (FileUtil .joinPath (outputDirectory , initialMetricsFileName ))) {
783760 LOG .info ("Output Initial DBMS metrics into file: {}" , initialMetricsFileName );
784- ps .print (initialParams );
761+ ps .print (initialParams );
785762 }
786763
787764 String metricsFileName = baseFileName + ".metrics.json" ;
@@ -797,7 +774,6 @@ private static void writeOutputs(
797774 rw .writeConfig (ps );
798775 }
799776
800-
801777 if (xmlConfig .getBoolean ("emitRaw" , false )) {
802778 String resultsFileName = baseFileName + ".results.csv" ;
803779 try (PrintStream ps = new PrintStream (FileUtil .joinPath (outputDirectory , resultsFileName ))) {
0 commit comments