Hyperfoil

httpRequest

Issues a HTTP request and registers handlers for the response.

Property Type Description
authority String HTTP authority (host:port) this request should target. Must match one of the entries in http section.
authority (alternative) Builder HTTP authority (host:port) this request should target. Must match one of the entries in http section.
body String HTTP request body (specified as string).
body (alternative) Builder HTTP request body.
CONNECT String Issue HTTP CONNECT request to given path.
CONNECT (alternative) Builder Issue HTTP CONNECT request to given path.
DELETE String Issue HTTP DELETE request to given path.
DELETE (alternative) Builder Issue HTTP DELETE request to given path.
GET String Issue HTTP GET request to given path.
GET (alternative) Builder Issue HTTP GET request to given path.
handler Builder HTTP response handlers.
HEAD String Issue HTTP HEAD request to given path.
HEAD (alternative) Builder Issue HTTP HEAD request to given path.
headers Builder HTTP headers sent in the request.
method enum HTTP method used for the request.
Options:
  • GET
  • HEAD
  • POST
  • PUT
  • DELETE
  • OPTIONS
  • PATCH
  • TRACE
  • CONNECT
metric String Requests statistics will use this metric name.
metric (alternative) <list of strings> Allows categorizing request statistics into metrics based on the request path.
OPTIONS String Issue HTTP OPTIONS request to given path.
OPTIONS (alternative) Builder Issue HTTP OPTIONS request to given path.
PATCH String Issue HTTP PATCH request to given path.
PATCH (alternative) Builder Issue HTTP PATCH request to given path.
path Builder HTTP path (absolute or relative), including query and fragment.
POST String Issue HTTP POST request to given path.
POST (alternative) Builder Issue HTTP POST request to given path.
PUT String Issue HTTP PUT request to given path.
PUT (alternative) Builder Issue HTTP PUT request to given path.
sla Builder List of SLAs the requests are subject to.
sync boolean This request is synchronous; execution of the sequence does not continue until the full response is received. If this step is executed from multiple parallel instances of this sequence the progress of all sequences is blocked until there is a request in flight without response. <p> Default is true.
timeout String Request timeout - after this time the request will be marked as failed and connection will be closed. <p> Defaults to value set globally in http section.
TRACE String Issue HTTP TRACE request to given path.
TRACE (alternative) Builder Issue HTTP TRACE request to given path.

authority

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

body

Allows building HTTP request body from session variables.

Property Type Description
form Builder Build form as if we were sending the request using HTML form. This option automatically adds Content-Type: application/x-www-form-urlencoded to the request headers.
fromFile String Send contents of the file. Note that this method does NOT set content-type automatically.
fromVar String Use variable content as request body.
pattern String Pattern replacing ${sessionvar} with variable contents in a string.
text String String sent as-is.

body.form

Build an URL-encoded HTML form body.

Property Type Description
<any> String Add simple name=value input pair.
<list of mappings> <list of builders> Add input pair described in the mapping.

body.form.<list of mappings>

Form element (e.g. as if coming from an INPUT field).

Property Type Description
fromVar String Input field value from session variable.
name String Input field name.
pattern String Input field value replacing session variables in a pattern, e.g. foo${myvariable}var
value String Input field value (verbatim).

CONNECT

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

DELETE

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

GET

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

handler

Manages processing of HTTP responses.

Property Type Description
body Processor.Builder Handle HTTP response body.
header HeaderHandler.Builder Handle HTTP response headers.
onCompletion Action.Builder Action executed when the HTTP response is fully received.
rawBytes RawBytesHandler.Builder Handler processing HTTP response before parsing.
status StatusHandler.Builder Handle HTTP response status.

handler.header

Handle HTTP response headers.

Property Type Description
countHeaders CountHeadersHandler.Builder Stores number of occurences of each header in custom statistics (these can be displayed in CLI using the stats -c command).
filter FilterHeaderHandler.Builder Compares if the header name matches expression and invokes a processor with the value.
logInvalid LogInvalidHandler.HeaderHandlerBuilder Logs headers from requests marked as invalid.
recordHeaderTime RecordHeaderTimeHandler.Builder Records alternative metric based on values from a header (e.g. when a proxy reports processing time).

handler.header.filter

Compares if the header name matches expression and invokes a processor with the value.

Property Type Description
header Builder Condition on the header name.
processor Processor.Builder Processor that will be invoked with the value (converted to ByteBuf).

handler.header.filter.header

Inline definition
String that should be matched.
Property Type Description
caseSensitive boolean True if the case must match, false if the check is case-insensitive.
endsWith CharSequence Suffix for the string.
matchVar String Fetch the value from a variable.
startsWith CharSequence Prefix for the string.
value CharSequence Literal value the condition should match.

handler.header.recordHeaderTime

Records alternative metric based on values from a header (e.g. when a proxy reports processing time).

Property Type Description
header String Header carrying the time.
metric String Name of the created metric.
unit String Time unit in the header; use either ms or ns.

handler.rawBytes

Handler processing HTTP response before parsing.

Property Type Description
transferSizeRecorder TransferSizeRecorder.Builder Accumulates request and response sizes into custom metrics.

handler.rawBytes.transferSizeRecorder

Accumulates request and response sizes into custom metrics.

Property Type Description
requestMetric String Name of the custom metric for collecting sent request bytes.
responseMetric String Name of the custom metric for collecting response bytes.

handler.status

Handle HTTP response status.

Property Type Description
counter StatusToCounterHandler.Builder Counts how many times given status is received.
range RangeStatusValidator.Builder Marks requests that don’t fall into the desired range as invalid.

handler.status.counter

Counts how many times given status is received.

Property Type Description
add int Number to be added to the session variable.
expectStatus int Expected status (others are ignored). All status codes match by default.
init int Initial value for the session variable.
set int Do not accumulate (add), just set the variable to this value.
var String Variable name.

handler.status.range

Marks requests that don’t fall into the desired range as invalid.

Inline definition
Single status code (204), masked code (2xx) or range (200-399).
Property Type Description
max int Highest accepted status code.
min int Lowest accepted status code.

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

headers

Property Type Description
<any> String Use header name (e.g. Content-Type) as key and value verbatim.
<any> (alternative) Builder Use header name (e.g. Content-Type) as key and specify value in the mapping.

headers.<any>

Specifies value that should be sent in headers.

Property Type Description
fromVar String Load header value from session variable.
pattern String Load header value using a pattern.

metric

Allows categorizing request statistics into metrics based on the request path.

Property Type Description
<list of strings> <list of strings> Allows categorizing request statistics into metrics based on the request path. The expressions are evaluated in the order as provided in the list. Use one of:
  • regexp -> replacement, e.g. ([^?]*)(\?.*)? -> $1 to drop the query part.
  • regexp (don't do any replaces and use the full path), e.g. .*.jpg
  • -> name (metric applied if none of the previous expressions match).

OPTIONS

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

PATCH

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

path

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

POST

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

PUT

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.

sla

Defines a list of Service Level Agreements (SLAs) - conditions that must hold for benchmark to be deemed successful.

Property Type Description
<list of mappings> <list of builders> <no description>

sla.<list of mappings>

Defines a Service Level Agreement (SLA) - conditions that must hold for benchmark to be deemed successful.

Property Type Description
blockedRatio double Maximum allowed ratio of time spent waiting for usable connection to sum of response latencies and blocked time. Default is 0 - client must not be blocked. Set to 1 if the client can block without limits.
errorRatio double Maximum allowed ratio of errors. Valid values are 0.0 - 1.0 (inclusive).
invalidRatio double Maximum allowed ratio of responses marked as invalid. Valid values are 0.0 - 1.0 (inclusive).
limits Builder Percentile limits.
meanResponseTime String Maximum allowed mean (average) response time. Use suffix ns, us, ms or s to specify units.
window String Period over which the stats should be collected. By default the SLA applies to stats from whole phase.

sla.<list of mappings>.limits

Percentile limits.

Property Type Description
<any> String Use percentile (value between 0.0 and 1.0) as key and response time with unit (e.g. ms) in suffix as value.

TRACE

Generic builder for generating a string.

Property Type Description
fromVar String Load the string from session variable.
pattern String Use pattern replacing session variables.
value String String value used verbatim.