We have a Java process, which we want to perform load testing on. This process makes a REST call to an external vendor. We want to monitor the performance over the weekend. It should be tested with around 1000 instances of the process running. What are the possible ways to do it?
I have 2 solutions:
Starting the process in multiple terminals, however given that we want to do this for 1000 instance is not practical.
Write a shell script to instantiate this, to clone.
Is there any better solution to this?
Any library would be helpful.
Below is the sample code that we want to schedule:
public static void main(String[] args) {
try {
getToken();
Thread.sleep(10000);
} catch (Exception e) {
e.printStackTrace();
}
final Timer timer = new Timer();
Timer stopTaskTimer = new Timer();
TimerTask task = new TimerTask() {
@Override
public void run() {
try {
/*getToken();
Thread.sleep(15000);*/
getResponse("#############");
} catch (Exception e) {
e.printStackTrace();
}
}
};
TimerTask stopTask = new TimerTask() {
@Override
public void run() {
timer.cancel();
}
};
timer.scheduleAtFixedRate(task, 0, 60000);
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = sdf.parse("2015-06-20 19:41:30");
//stopTaskTimer.schedule(stopTask, date);
} catch (ParseException e) {
e.printStackTrace();
}
}
Use JMeter or other comparable load testing tool. It supports all you require out of box.