com.elastisys.scale.commons.logreplayer.LogReplayerMain Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons.logreplayer Show documentation
Show all versions of commons.logreplayer Show documentation
simple replayer of apache log files
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();
}
}