UNPKG

@gatling.io/core

Version:

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

127 lines (126 loc) 5.15 kB
import { Wrapper } from "./common"; import { Duration } from "./utils/duration"; import JvmClosedInjectionStep = io.gatling.javaapi.core.ClosedInjectionStep; import JvmClosedInjectionStepConstant = io.gatling.javaapi.core.ClosedInjectionStep$Constant; import JvmClosedInjectionStepRamp = io.gatling.javaapi.core.ClosedInjectionStep$Ramp; import JvmClosedInjectionStepRampTo = io.gatling.javaapi.core.ClosedInjectionStep$RampTo; import JvmClosedInjectionStepStairs = io.gatling.javaapi.core.ClosedInjectionStep$Stairs; import JvmClosedInjectionStepStairsWithTime = io.gatling.javaapi.core.ClosedInjectionStep$StairsWithTime; /** * An injection profile step for using a closed workload model where you control the concurrent * number of users. Only use if your system has a queue limiting entry. Don't use otherwise or your * test will not match any production use case. * * <p>Immutable, so all methods return a new occurrence and leave the original unmodified. */ export interface ClosedInjectionStep extends Wrapper<JvmClosedInjectionStep> { } /** * DSL component for building a {@link ClosedInjectionStep} that will inject new users in a way to * maintain a constant number of concurrent users for a given duration. */ export interface ClosedInjectionStepConstant extends Wrapper<JvmClosedInjectionStepConstant> { /** * Define the duration of the step * * @param duration - the duration * @returns a new ClosedInjectionStep */ during(duration: Duration): ClosedInjectionStep; } /** * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp * the number of concurrent users for a given duration. */ export interface ClosedInjectionStepRamp extends Wrapper<JvmClosedInjectionStepRamp> { /** * Define the target number of concurrent users at the end of the ramp. * * @param t - the target number * @returns a RampConcurrentUsersInjectionTo */ to(t: number): ClosedInjectionStepRampTo; } /** * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp * the number of concurrent users for a given duration. */ export interface ClosedInjectionStepRampTo extends Wrapper<JvmClosedInjectionStepRampTo> { /** * Define the duration of the ramp. * * @param duration - the duration * @returns a complete ClosedInjectionStep */ during(duration: Duration): ClosedInjectionStep; } /** * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp * the number of concurrent users in a stairs fashion */ export interface ClosedInjectionStepStairs extends Wrapper<JvmClosedInjectionStepStairs> { /** * Define the number of levels * * @param levels - the number of levels in the stairs * @returns the next DSL step */ times(levels: number): ClosedInjectionStepStairsWithTime; } /** * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp * the number of concurrent users in a stairs fashion */ export interface ClosedInjectionStepStairsWithTime extends Wrapper<JvmClosedInjectionStepStairsWithTime> { /** * Define the duration of each level * * @param duration - the duration * @returns the next DSL step */ eachLevelLasting(duration: Duration): ClosedInjectionStepComposite; } /** * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp * the number of concurrent users in a stairs fashion */ export interface ClosedInjectionStepComposite extends ClosedInjectionStep { /** * Define the initial number of concurrent users (optional) * * @param startingUsers - the initial number of concurrent users * @returns a usable {@link ClosedInjectionStep} */ startingFrom(startingUsers: number): ClosedInjectionStepComposite; /** * Define ramps separating levels (optional) * * @param duration - the duration of the ramps * @returns a usable {@link ClosedInjectionStep} */ separatedByRampsLasting(duration: Duration): ClosedInjectionStepComposite; } /** * Bootstrap a new closed workload constantConcurrentUsers injection profile, see {@link * ClosedInjectionStepConstant} * * @param users - the number of concurrent users * @returns the next DSL step */ export declare const constantConcurrentUsers: (users: number) => ClosedInjectionStepConstant; /** * Bootstrap a new closed workload rampConcurrentUsers injection profile, see {@link * ClosedInjectionStepRamp} * * @param from - the number of concurrent users at the start of the ramp * @returns the next DSL step */ export declare const rampConcurrentUsers: (from: number) => ClosedInjectionStepRamp; /** * Bootstrap a new closed workload incrementConcurrentUsers injection profile, see {@link * ClosedInjectionStepStairs} * * @param usersIncrement - the difference of concurrent users between levels of the stairs * @returns the next DSL step */ export declare const incrementConcurrentUsers: (usersIncrement: number) => ClosedInjectionStepStairs;