UNPKG

@gatling.io/core

Version:

Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).

46 lines (45 loc) 1.8 kB
import { Wrapper } from "../common"; import { SessionTransform } from "../session"; import JvmActionBuilder = io.gatling.javaapi.core.ActionBuilder; import JvmExecs = io.gatling.javaapi.core.exec.Execs; import JvmExecutable = io.gatling.javaapi.core.exec.Executable; export interface Executable<T extends JvmExecutable> extends Wrapper<T> { } export interface ActionBuilder extends Executable<JvmActionBuilder> { } export declare const wrapActionBuilder: (_underlying: JvmActionBuilder) => ActionBuilder; export interface ExecFunction<T extends Execs<T>> { /** * Attach some `Executable`s. Chains will be attached sequentially. * * @example * ```ts * const chain1: ChainBuilder = ??? * const chain2: ChainBuilder = ??? * const chain1ThenChain2 = exec(chain1, chain2) * ``` * * @param executable - some `ChainBuilder` or `ActionBuilder` * @param executables - other `ChainBuilder`s or `ActionBuilder`s * @returns a new `StructureBuilder` */ (executable: Executable<any>, ...executables: Array<Executable<any>>): T; /** * Attach a new action that will execute a function. Important: the function must only perform * fast in-memory operations. In particular, it mustn't perform any long block I/O operation, or * it will hurt Gatling performance badly. * * @example * ```ts * exec(session => session.set("foo", "bar")) * ``` * * @param executable - the function * @returns a new `StructureBuilder` */ (executable: SessionTransform): T; } export interface Execs<T extends Execs<T>> { exec: ExecFunction<T>; } export declare const execImpl: <J2, J1 extends JvmExecs<J2, any>, T extends Execs<T>>(jvmExecs: J1, wrap: (wrapped: J2) => T) => ExecFunction<T>;