Class LoadTester
This simulates a number
of simultaneous clients performing
the same search task a number
of times, to simulate load
conditions.
The search task is:
search
- Start a searchgetMatches
- Get all matches (with 5 tokens context)getMatchAnnotations
- Get annotations on two layers for all matchesgetFragments
- Get TextGrids with two tiers for all matchesgetSoundFragments
- Get audio for all matches
Firstly, the total time for each of these, for one client, is measured for "idle" conditions comparison. Then simultaneous clients are started, each repeating the task. When all have finished, the mean time for each of the above is shown.
To invoke the load tester from the command line:
java -classpath lib/nzilbb.ag.jar:bin/nzilbb.labbcat.jar nzilbb.labbcat.util.LoadTester --labbcaturl=url --username=user --password=password
Other command line options include:
- --clients=n - Number of clients to simulate (default is 3).
- --repetitions=n - Number of clients to simulate (default is 1)
- --clientdelay=n - Number of seconds to wait before starting each new client (default is 5).
- --searchfor=s - The orthography to search for when running searches
(default is
i
) - --maxMatches=n - The maximum number of matches to process (default is 200).
- --verbose - Produce verbose logging.
Once the utility is complete, a report is printed showing the mean time for each step of the task, compared with the idle-conditions time for the same step, e.g.:
Getting statistics when idle......... Match count from searching for "i": 910 Idle conditions: search: 4.339s getMatches: 3.208s getMatchAnnotations: 0.133s getFragments: 66.088s getSoundFragments: 0.675s Simulating 10 clients doing 1 search each............................................................... Load conditions: search: 14.960s (idle: 4.339s) getMatches: 7.820s (idle: 3.208s) getMatchAnnotations: 0.184s (idle: 0.133s) getFragments: 292.374s (idle: 66.088s) getSoundFragments: 0.948s (idle: 0.675s)
- Author:
- Robert Fromont robert@fromont.net.nz
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter forclientDelay
: Number of seconds to wait before starting each new client.Getter forclients
: Number of clients to simulate.Getter forfragments
: Call getFragments as part of the test.Getter forlabbcatUrl
: Base URL for the LaBB-CAT server.Getter formatchAnnotations
: Call getMatchAnnotations as part of the test.Getter formaxMatches
: The maximum number of matches to process (for annotations and fragments).Getter forotherLayer
: ID of other layer (apart from orthography) to get annotations from (default is "phonemes").Getter forpassword
: Password for LaBB-CAT.Getter forrepetitions
: Number of times each client should repeat the test task.Getter forsearchFor
: The orthography to search for when running searches.Getter forsoundFragments
: Call getSoundFragments as part of the test.Getter forusername
: Username for LaBB-CAT.Getter forverbose
: Whether to produce verbose logging.static void
Main entrypoint.setClientDelay
(Integer newClientDelay) Setter forclientDelay
: Number of seconds to wait before starting each new client.setClients
(Integer newClients) Setter forclients
: Number of clients to simulate.setFragments
(Boolean newFragments) Setter forfragments
: Call getFragments as part of the test.setLabbcatUrl
(String newLabbcatUrl) Setter forlabbcatUrl
: Base URL for the LaBB-CAT server.setMatchAnnotations
(Boolean newMatchAnnotations) Setter formatchAnnotations
: Call getMatchAnnotations as part of the test.setMaxMatches
(Integer newMaxMatches) Setter formaxMatches
: The maximum number of matches to process (for annotations and fragments).setOtherLayer
(String newOtherLayer) Setter forotherLayer
: ID of other layer (apart from orthography) to get annotations from (default is "phonemes").setPassword
(String newPassword) Setter forpassword
: Password for LaBB-CAT.setRepetitions
(Integer newRepetitions) Setter forrepetitions
: Number of times each client should repeat the test task.setSearchFor
(String newSearchFor) Setter forsearchFor
: The orthography to search for when running searches.setSoundFragments
(Boolean newSoundFragments) Setter forsoundFragments
: Call getSoundFragments as part of the test.setUsername
(String newUsername) Setter forusername
: Username for LaBB-CAT.setVerbose
(Boolean newVerbose) Setter forverbose
: Whether to produce verbose logging.void
start()
Start the utilityMethods inherited from class nzilbb.util.CommandLineProgram
error, error, getUsage, getV, getVersion, interpretPropertiesParameters, message, processArguments, setUsage, setV, setVersion, warning, warning
-
Field Details
-
seconds
Decimal format for seconds.
-
-
Constructor Details
-
LoadTester
public LoadTester()Default constructor.
-
-
Method Details
-
main
Main entrypoint.- Parameters:
argv
- An array of command line parameters.
-
getLabbcatUrl
Getter forlabbcatUrl
: Base URL for the LaBB-CAT server.- Returns:
- Base URL for the LaBB-CAT server.
-
setLabbcatUrl
@Switch(value="Base URL for the LaBB-CAT server.", compulsory=true) public LoadTester setLabbcatUrl(String newLabbcatUrl) Setter forlabbcatUrl
: Base URL for the LaBB-CAT server.- Parameters:
newLabbcatUrl
- Base URL for the LaBB-CAT server.- Returns:
- A reference to this object, so that setters can be chained.
-
getUsername
Getter forusername
: Username for LaBB-CAT.- Returns:
- Username for LaBB-CAT.
-
setUsername
Setter forusername
: Username for LaBB-CAT.- Parameters:
newUsername
- Username for LaBB-CAT.- Returns:
- A reference to this object, so that setters can be chained.
-
getPassword
Getter forpassword
: Password for LaBB-CAT.- Returns:
- Password for LaBB-CAT.
-
setPassword
Setter forpassword
: Password for LaBB-CAT.- Parameters:
newPassword
- Password for LaBB-CAT.- Returns:
- A reference to this object, so that setters can be chained.
-
getClients
Getter forclients
: Number of clients to simulate.- Returns:
- Number of clients to simulate.
-
setClients
@Switch("Number of clients to simulate (default is 3).") public LoadTester setClients(Integer newClients) Setter forclients
: Number of clients to simulate.- Parameters:
newClients
- Number of clients to simulate.- Returns:
- A reference to this object, so that setters can be chained.
-
getRepetitions
Getter forrepetitions
: Number of times each client should repeat the test task.- Returns:
- Number of times each client should repeat the test task.
-
setRepetitions
@Switch("Number of times each client should repeat the test task (default is 1).") public LoadTester setRepetitions(Integer newRepetitions) Setter forrepetitions
: Number of times each client should repeat the test task.- Parameters:
newRepetitions
- Number of times each client should repeat the test task.- Returns:
- A reference to this object, so that setters can be chained.
-
getClientDelay
Getter forclientDelay
: Number of seconds to wait before starting each new client.- Returns:
- Number of seconds to wait before starting each new client.
-
setClientDelay
@Switch("Number of seconds to wait before starting each new client (default is 5).") public LoadTester setClientDelay(Integer newClientDelay) Setter forclientDelay
: Number of seconds to wait before starting each new client.- Parameters:
newClientDelay
- Number of seconds to wait before starting each new client.- Returns:
- A reference to this object, so that setters can be chained.
-
getSearchFor
Getter forsearchFor
: The orthography to search for when running searches.- Returns:
- The orthography to search for when running searches.
-
setSearchFor
@Switch("The orthography to search for when running searches (default is \"i\").") public LoadTester setSearchFor(String newSearchFor) Setter forsearchFor
: The orthography to search for when running searches.- Parameters:
newSearchFor
- The orthography to search for when running searches.- Returns:
- A reference to this object, so that setters can be chained.
-
getOtherLayer
Getter forotherLayer
: ID of other layer (apart from orthography) to get annotations from (default is "phonemes").- Returns:
- ID of other layer (apart from orthography) to get annotations from (default is "phonemes").
-
setOtherLayer
@Switch("ID of other layer (apart from orthography) to get annotations from (default is \"phonemes\").") public LoadTester setOtherLayer(String newOtherLayer) Setter forotherLayer
: ID of other layer (apart from orthography) to get annotations from (default is "phonemes").- Parameters:
newOtherLayer
- ID of other layer (apart from orthography) to get annotations from (default is "phonemes").- Returns:
- A reference to this object, so that setters can be chained.
-
getMaxMatches
Getter formaxMatches
: The maximum number of matches to process (for annotations and fragments).- Returns:
- The maximum number of matches to process (for annotations and fragments).
-
setMaxMatches
@Switch("The maximum number of matches to process (default is 200).") public LoadTester setMaxMatches(Integer newMaxMatches) Setter formaxMatches
: The maximum number of matches to process (for annotations and fragments).- Parameters:
newMaxMatches
- The maximum number of matches to process (for annotations and fragments).- Returns:
- A reference to this object, so that setters can be chained.
-
getMatchAnnotations
Getter formatchAnnotations
: Call getMatchAnnotations as part of the test.- Returns:
- Call getMatchAnnotations as part of the test.
-
setMatchAnnotations
@Switch("Call getMatchAnnotations as part of the test (default is TRUE).") public LoadTester setMatchAnnotations(Boolean newMatchAnnotations) Setter formatchAnnotations
: Call getMatchAnnotations as part of the test.- Parameters:
newMatchAnnotations
- Call getMatchAnnotations as part of the test.- Returns:
- A reference to this object, so that setters can be chained.
-
getFragments
Getter forfragments
: Call getFragments as part of the test.- Returns:
- Call getFragments as part of the test.
-
setFragments
@Switch("Call getFragments as part of the test (default is TRUE).") public LoadTester setFragments(Boolean newFragments) Setter forfragments
: Call getFragments as part of the test.- Parameters:
newFragments
- Call getFragments as part of the test.- Returns:
- A reference to this object, so that setters can be chained.
-
getSoundFragments
Getter forsoundFragments
: Call getSoundFragments as part of the test.- Returns:
- Call getSoundFragments as part of the test.
-
setSoundFragments
@Switch("Call getSoundFragments as part of the test (default is TRUE).") public LoadTester setSoundFragments(Boolean newSoundFragments) Setter forsoundFragments
: Call getSoundFragments as part of the test.- Parameters:
newSoundFragments
- Call getSoundFragments as part of the test.- Returns:
- A reference to this object, so that setters can be chained.
-
getVerbose
Getter forverbose
: Whether to produce verbose logging.- Returns:
- Whether to produce verbose logging.
-
setVerbose
Setter forverbose
: Whether to produce verbose logging.- Parameters:
newVerbose
- Whether to produce verbose logging.- Returns:
- A reference to this object, so that setters can be chained.
-
start
public void start()Start the utility
-