Example usage for org.apache.http.contrib.benchmark CommandLineUtils parseCommandLine

List of usage examples for org.apache.http.contrib.benchmark CommandLineUtils parseCommandLine

Introduction

In this page you can find the example usage for org.apache.http.contrib.benchmark CommandLineUtils parseCommandLine.

Prototype

static void parseCommandLine(CommandLine cmd, HttpBenchmark httpBenchmark) 

Source Link

Usage

From source file:org.apache.http.contrib.benchmark.HttpBenchmark.java

public static void main(String[] args) throws Exception {

    Options options = CommandLineUtils.getOptions();
    CommandLineParser parser = new PosixParser();
    CommandLine cmd = parser.parse(options, args);

    if (args.length == 0 || cmd.hasOption('h') || cmd.getArgs().length != 1) {
        CommandLineUtils.showUsage(options);
        System.exit(1);//  w  w w . ja v  a 2 s.co m
    }

    HttpBenchmark httpBenchmark = new HttpBenchmark();
    CommandLineUtils.parseCommandLine(cmd, httpBenchmark);
    httpBenchmark.execute();
}