@gatling.io/core
Version:
Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
123 lines (122 loc) • 6.15 kB
TypeScript
import { Duration } from "../utils/duration";
import { SessionTo } from "../session";
import { On } from "./on";
import JvmDuring = io.gatling.javaapi.core.loop.During;
export interface DuringFunction<T extends During<T>> {
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration, in seconds or with an explicit time unit
* @returns a DSL component for defining the loop content
*/
(duration: Duration): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration, in seconds or with an explicit time unit
* @param exitASAP - if the loop must be interrupted if the max duration is reached inside the loop
* @returns a DSL component for defining the loop content
*/
(duration: Duration, exitASAP: boolean): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration, in seconds or with an explicit time unit
* @param counterName - the name of the loop counter, as stored in the Session
* @returns a DSL component for defining the loop content
*/
(duration: Duration, counterName: string): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration, in seconds or with an explicit time unit
* @param counterName - the name of the loop counter, as stored in the Session
* @param exitASAP - if the loop must be interrupted if the max duration is reached inside the loop
* @returns a DSL component for defining the loop content
*/
(duration: Duration, counterName: string, exitASAP: boolean): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration as a Gatling Expression Language string. This expression must resolve to
* either a number, then the unit will be seconds, or an object with an explicit time unit.
* @returns a DSL component for defining the loop content
*/
(duration: string): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration as a Gatling Expression Language string. This expression must resolve to
* either a number, then the unit will be seconds, or an object with an explicit time unit.
* @param exitASAP - if the loop must be interrupted if the max duration is reached inside the loop
* @returns a DSL component for defining the loop content
*/
(duration: string, exitASAP: boolean): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration as a Gatling Expression Language string. This expression must resolve to
* either a number, then the unit will be seconds, or an object with an explicit time unit.
* @param counterName - the name of the loop counter, as stored in the Session
* @returns a DSL component for defining the loop content
*/
(duration: string, counterName: string): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration as a Gatling Expression Language string. This expression must resolve to
* either a number, then the unit will be seconds, or an object with an explicit time unit.
* @param counterName - the name of the loop counter, as stored in the Session
* @param exitASAP - if the loop must be interrupted if the max duration is reached inside the loop
* @returns a DSL component for defining the loop content
*/
(duration: string, counterName: string, exitASAP: boolean): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration as a function
* @returns a DSL component for defining the loop content
*/
(duration: SessionTo<Duration>): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration as a function
* @param exitASAP - if the loop must be interrupted if the max duration is reached inside the loop
* @returns a DSL component for defining the loop content
*/
(duration: SessionTo<Duration>, exitASAP: boolean): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration as a function
* @param counterName - the name of the loop counter, as stored in the Session
* @returns a DSL component for defining the loop content
*/
(duration: SessionTo<Duration>, counterName: string): On<T>;
/**
* Define a loop that will iterate for a given duration. The condition is evaluated at the end of
* the loop.
*
* @param duration - the maximum duration as a function
* @param counterName - the name of the loop counter, as stored in the Session
* @param exitASAP - if the loop must be interrupted if the max duration is reached inside the loop
* @returns a DSL component for defining the loop content
*/
(duration: SessionTo<Duration>, counterName: string, exitASAP: boolean): On<T>;
}
export interface During<T extends During<T>> {
during: DuringFunction<T>;
}
export declare const duringImpl: <J2, J1 extends JvmDuring<J2, any>, T extends During<T>>(jvmDuring: J1, wrap: (wrapped: J2) => T) => DuringFunction<T>;