All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.elastisys.scale.commons.logreplayer.LogReplayerMain Maven / Gradle / Ivy

There is a newer version: 2.3.4
Show newest version
package com.elastisys.scale.commons.logreplayer;

import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;

public class LogReplayerMain {

	public static void main(String[] args) {
		LogReplayerOptions options = new LogReplayerOptions();
		CmdLineParser parser = new CmdLineParser(options);
		parser.setUsageWidth(80);

		try {
			parser.parseArgument(args);
			if (options.arguments.size() < 1) {
				throw new CmdLineException(parser,
						"missing argument: ");
			}
			if (options.arguments.size() < 2) {
				throw new CmdLineException(parser,
						"missing argument: ");
			}
		} catch (CmdLineException e) {
			System.err.println("error: " + e.getMessage());
			System.err
					.println("usage: java LogReplayer [options]  ");
			parser.printUsage(System.err);
			System.exit(-1);
		}

		String logFile = options.arguments.get(0);
		String targetUrl = options.arguments.get(1);
		int burstDuration = options.burstDuration;

		BurstingApacheLogReplayer replayer = new BurstingApacheLogReplayer(
				logFile, targetUrl, burstDuration);
		replayer.run();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy