Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Groovy based tool for performing load testing of HTTP or java applications.
Java Groovy
branch: master

This branch is 25 commits ahead, 26 commits behind oleksiyp:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/main
.gitignore
Crawler.groovy
Example1.groovy
Example2.groovy
README.textile
loadtest-1.0.jar
pom.xml

README.textile

Loadtest tool

This tool could be used to test load your web application using different scenarios. Scripts are written in groovy using loadtest API.

Run

Copy one loadtest-1.0.jar and Example*.groovy from repository to a directory on your computer. Use java to run it from commandline:

java -jar loadtest-1.0.jar Example1.groovy

Use -h option to display command line information:

java -jar loadtest-1.0.jar -h
java -jar loadtest.jar [options...] scripts...
 -c (--threads) N            : Number of concurrent threads
 -ci (--threads-increment) N : Number of concurrent threads to increment after
                               stop/start (use [ENTER])
 -d (--delay) N              : Seconds to delay between requests
 -e (--eval) VAL             : Evaluate groovy script
 -h (--help)                 : Display usage information
 -ie (--init-eval) VAL       : Evaluate init script to initialize globals
 -if (--init-file) FILE      : Runs init script to initialize globals
 -n (--runs-number) N        : Number of runs to perform
 -s (--show-slows) N         : Number of the slowest queries to show in
                               statistics(by default 24)

Loadtest API

For groovy scripts following classes are available: HTTP and Variations. HTTP class could be used to create load. Variation helps to create non-deterministic behavior. For details please refer to the groovy documentation and src/main/resources/org/loadtest/Classes.groovy

Variations

select(prob1, closure1, prob2, closure2, prob3, closure3, …)

Select one of the closures to execute depending on probability. Probabilities could be not normalized: i.e. sum(prob~i~) != 1.0

takeAny(arguments…);

Select one of arguments with equal probability.

HTTP

get([Closure reporter, ]String …urls)

Gets value of one(!randomly selected) of urls and reads line by line calling reporter(line). If reporter is not specified returns array of strings – lines of this file.

parse(Pattern regex, String …html)

Process text thought regular expression and selects regular expression groups. Returns 2-d array if several groups used and 1-d if one.

resolve(String name, String path)

Resolves path relative to name.

Globals

get(String name)

Get variable value shared in global map.

put(String name, Object value)

Set variable value shared in global map.

list(String name, Object …initValues)

Initialize list(synchronized) in global map with values initValues.

increment(String name)

Gets counter and increments or initializes it with 0 at start.

Tasks

Features

Ask

Protocols

  • 30% HTTP
  • 0% FTP
  • 0% java call(classpath collector)

Proxies

  • 0% HTTP proxy
  • 0% internal proxy

Statistics

  • 0% Save statistics to file
  • 0% Process file to calculate percentiles, etc
  • 0% Prepare data for Excel, GNU PLOT etc

License

Load test tool is distributed on terms of BSD-license. Look at src/main/resources/BSD-LICENSE.txt for details.

Groovy used internally by load test tool is licensed under the Apache 2 license:

http://www.apache.org/licenses/LICENSE-2.0.html

Something went wrong with that request. Please try again.