UNPKG

@gatling.io/core

Version:

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

37 lines (36 loc) 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.jumpToRps = exports.holdFor = exports.reachRps = void 0; const jvm_types_1 = require("@gatling.io/jvm-types"); const duration_1 = require("./utils/duration"); /** * Bootstrap a new reachRps throttling profile, see {@link ThrottleStepReachIntermediate} * * @param target - the target requests per second * @returns the next DSL step */ const reachRps = (target) => wrapThrottleStepReachIntermediate(jvm_types_1.CoreDsl.reachRps(target)); exports.reachRps = reachRps; /** * Bootstrap a new holdFor throttling profile that limits rps to its current value * * @param duration - the duration of the plateau in seconds * @returns the next DSL step */ const holdFor = (duration) => wrapThrottleStep(jvm_types_1.CoreDsl.holdFor((0, duration_1.toJvmDuration)(duration))); exports.holdFor = holdFor; /** * Bootstrap a new jumpToRps throttling profile that change the rps limit to a new value * * @param target - the new limit * @returns the next DSL step */ const jumpToRps = (target) => wrapThrottleStep(jvm_types_1.CoreDsl.jumpToRps(target)); exports.jumpToRps = jumpToRps; const wrapThrottleStep = (_underlying) => ({ _underlying }); const wrapThrottleStepReachIntermediate = (_underlying) => ({ in: (duration) => wrapThrottleStep(_underlying.in((0, duration_1.toJvmDuration)(duration))), during: (duration) => wrapThrottleStep(_underlying.during((0, duration_1.toJvmDuration)(duration))) });