Package org.apache.http.benchmark

Examples of org.apache.http.benchmark.Config


    private static final int PORT = 8989;
   
    public static void main(String[] args) throws Exception {
       
        Config config = new Config();
        if (args.length > 0) {
            Options options = CommandLineUtils.getOptions();
            CommandLineParser parser = new PosixParser();
            CommandLine cmd = parser.parse(options, args);
            if (cmd.hasOption('h')) {
                HelpFormatter formatter = new HelpFormatter();
                formatter.printHelp("Benchmark [options]", options);
                System.exit(1);
            }
            CommandLineUtils.parseCommandLine(cmd, config);
        } else {
            config.setKeepAlive(true);
            config.setRequests(20000);
            config.setThreads(25);
        }
       
        URL target = new URL("http", "localhost", PORT, "/rnd?c=2048");
        config.setUrl(target);
       
        Benchmark benchmark = new Benchmark();
        benchmark.run(new JettyServer(PORT), config);
        benchmark.run(new HttpCoreServer(PORT), config);
        benchmark.run(new JettyNIOServer(PORT), config);
View Full Code Here


    private static final int PORT = 8989;

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

        Config config = new Config();
        if (args.length > 0) {
            Options options = CommandLineUtils.getOptions();
            CommandLineParser parser = new PosixParser();
            CommandLine cmd = parser.parse(options, args);
            if (cmd.hasOption('h')) {
                HelpFormatter formatter = new HelpFormatter();
                formatter.printHelp("Benchmark [options]", options);
                System.exit(1);
            }
            CommandLineUtils.parseCommandLine(cmd, config);
        } else {
            config.setKeepAlive(true);
            config.setRequests(20000);
            config.setThreads(25);
        }

        URL target = new URL("http", "localhost", PORT, "/rnd?c=2048");
        config.setUrl(target);

        Benchmark benchmark = new Benchmark();
        benchmark.run(new JettyServer(PORT), config);
        benchmark.run(new HttpCoreServer(PORT), config);
        benchmark.run(new JettyNIOServer(PORT), config);
View Full Code Here

TOP

Related Classes of org.apache.http.benchmark.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.