Package org.astrogrid.samp.test
Class CalcStorm
- java.lang.Object
-
- org.astrogrid.samp.test.CalcStorm
-
public class CalcStorm extends java.lang.Object
Runs a load of Calculator clients at once all sending messages to each other. Suitable for load testing or benchmarking a hub.- Since:
- 22 Jul 2008
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger_
private int
nClient_
private int
nQuery_
private ClientProfile
profile_
private java.util.Random
random_
private Calculator.SendMode
sendMode_
-
Constructor Summary
Constructors Constructor Description CalcStorm(ClientProfile profile, java.util.Random random, int nClient, int nQuery, Calculator.SendMode sendMode)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
Main method.void
run()
Runs a lot of calculators at once all talking to each other.static int
runMain(java.lang.String[] args)
Does the work for the main method.
-
-
-
Field Detail
-
profile_
private final ClientProfile profile_
-
random_
private final java.util.Random random_
-
nClient_
private final int nClient_
-
nQuery_
private final int nQuery_
-
sendMode_
private final Calculator.SendMode sendMode_
-
logger_
private static final java.util.logging.Logger logger_
-
-
Constructor Detail
-
CalcStorm
public CalcStorm(ClientProfile profile, java.util.Random random, int nClient, int nQuery, Calculator.SendMode sendMode)
Constructor.- Parameters:
profile
- hub connection factoryrandom
- random number generatornClient
- number of clients to runnQuery
- number of messages each client will sendsendMode
- delivery pattern for messages
-
-
Method Detail
-
run
public void run() throws java.io.IOException
Runs a lot of calculators at once all talking to each other.- Throws:
TestException
- if any tests failjava.io.IOException
-
runMain
public static int runMain(java.lang.String[] args) throws java.io.IOException
Does the work for the main method. Use -help flag for documentation.- Parameters:
args
- command-line arguments- Returns:
- 0 means success
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
Main method. Use -help flag.- Throws:
java.io.IOException
-
-