UNPKG

@gatling.io/core

Version:

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

59 lines (58 loc) 2.87 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.incrementConcurrentUsers = exports.rampConcurrentUsers = exports.constantConcurrentUsers = void 0; const jvm_types_1 = require("@gatling.io/jvm-types"); const duration_1 = require("./utils/duration"); const wrapClosedInjectionStep = (_underlying) => ({ _underlying }); const wrapClosedInjectionStepConstant = (_underlying) => ({ _underlying, during: (duration) => wrapClosedInjectionStep(_underlying.during((0, duration_1.toJvmDuration)(duration))) }); const wrapClosedInjectionStepRamp = (_underlying) => ({ _underlying, to: (t) => wrapClosedInjectionStepRampTo(_underlying.to(t)) }); const wrapClosedInjectionStepRampTo = (_underlying) => ({ _underlying, during: (duration) => wrapClosedInjectionStep(_underlying.during((0, duration_1.toJvmDuration)(duration))) }); const wrapClosedInjectionStepStairs = (_underlying) => ({ _underlying, times: (levels) => wrapClosedInjectionStepStairsWithTime(_underlying.times(levels)) }); const wrapClosedInjectionStepStairsWithTime = (_underlying) => ({ _underlying, eachLevelLasting: (duration) => wrapClosedInjectionStepComposite(_underlying.eachLevelLasting((0, duration_1.toJvmDuration)(duration))) }); const wrapClosedInjectionStepComposite = (_underlying) => ({ _underlying, startingFrom: (startingUsers) => wrapClosedInjectionStepComposite(_underlying.startingFrom(startingUsers)), separatedByRampsLasting: (duration) => wrapClosedInjectionStepComposite(_underlying.separatedByRampsLasting((0, duration_1.toJvmDuration)(duration))) }); /** * Bootstrap a new closed workload constantConcurrentUsers injection profile, see {@link * ClosedInjectionStepConstant} * * @param users - the number of concurrent users * @returns the next DSL step */ const constantConcurrentUsers = (users) => wrapClosedInjectionStepConstant(jvm_types_1.CoreDsl.constantConcurrentUsers(users)); exports.constantConcurrentUsers = constantConcurrentUsers; /** * 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 */ const rampConcurrentUsers = (from) => wrapClosedInjectionStepRamp(jvm_types_1.CoreDsl.rampConcurrentUsers(from)); exports.rampConcurrentUsers = rampConcurrentUsers; /** * 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 */ const incrementConcurrentUsers = (usersIncrement) => wrapClosedInjectionStepStairs(jvm_types_1.CoreDsl.incrementConcurrentUsers(usersIncrement)); exports.incrementConcurrentUsers = incrementConcurrentUsers;