@param args @throws Exception
(String[] args)
| 56 | * @throws Exception |
| 57 | */ |
| 58 | public static void main(String[] args) throws Exception { |
| 59 | |
| 60 | // create the command line parser |
| 61 | CommandLineParser parser = new DefaultParser(); |
| 62 | |
| 63 | XMLConfiguration pluginConfig = buildConfiguration("config/plugin.xml"); |
| 64 | |
| 65 | Options options = buildOptions(pluginConfig); |
| 66 | |
| 67 | CommandLine argsLine = parser.parse(options, args); |
| 68 | |
| 69 | if (argsLine.hasOption("h")) { |
| 70 | printUsage(options); |
| 71 | return; |
| 72 | } else if (!argsLine.hasOption("c")) { |
| 73 | LOG.error("Missing Configuration file"); |
| 74 | printUsage(options); |
| 75 | return; |
| 76 | } else if (!argsLine.hasOption("b")) { |
| 77 | LOG.error("Missing Benchmark Class to load"); |
| 78 | printUsage(options); |
| 79 | return; |
| 80 | } |
| 81 | |
| 82 | // Monitoring setup. |
| 83 | ImmutableMonitorInfo.Builder builder = ImmutableMonitorInfo.builder(); |
| 84 | if (argsLine.hasOption("im")) { |
| 85 | builder.monitoringInterval(Integer.parseInt(argsLine.getOptionValue("im"))); |
| 86 | } |
| 87 | if (argsLine.hasOption("mt")) { |
| 88 | switch (argsLine.getOptionValue("mt")) { |
| 89 | case "advanced": |
| 90 | builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); |
| 91 | break; |
| 92 | case "throughput": |
| 93 | builder.monitoringType(MonitorInfo.MonitoringType.THROUGHPUT); |
| 94 | break; |
| 95 | default: |
| 96 | throw new ParseException( |
| 97 | "Monitoring type '" |
| 98 | + argsLine.getOptionValue("mt") |
| 99 | + "' is undefined, allowed values are: advanced/throughput"); |
| 100 | } |
| 101 | } |
| 102 | MonitorInfo monitorInfo = builder.build(); |
| 103 | |
| 104 | // ------------------------------------------------------------------- |
| 105 | // GET PLUGIN LIST |
| 106 | // ------------------------------------------------------------------- |
| 107 | |
| 108 | String targetBenchmarks = argsLine.getOptionValue("b"); |
| 109 | |
| 110 | String[] targetList = targetBenchmarks.split(","); |
| 111 | List<BenchmarkModule> benchList = new ArrayList<>(); |
| 112 | |
| 113 | // Use this list for filtering of the output |
| 114 | List<TransactionType> activeTXTypes = new ArrayList<>(); |
| 115 |
nothing calls this directly
no test coverage detected