UNPKG

@gatling.io/core

Version:

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

57 lines (56 loc) 2.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.paceImpl = void 0; const duration_1 = require("../utils/duration"); const session_1 = require("../session"); const paceImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => { if (arg2 !== undefined) { // pace(min, max, counterName) if (typeof arg0 === "string" && typeof arg1 === "string") { return wrap(jvmGroups.pace(arg0, arg1, arg2)); } else if (typeof arg0 === "function" && typeof arg1 === "function") { return wrap(jvmGroups.pace((0, session_1.underlyingSessionToDuration)(arg0), (0, session_1.underlyingSessionToDuration)(arg1), arg2)); } else if ((0, duration_1.isDuration)(arg0) && (0, duration_1.isDuration)(arg1)) { return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), (0, duration_1.toJvmDuration)(arg1), arg2)); } } else if (arg1 !== undefined) { if (typeof arg1 === "string") { // pace(duration, counterName) if (typeof arg0 === "string") { return wrap(jvmGroups.pace(arg0, arg1)); } else if (typeof arg0 === "function") { return wrap(jvmGroups.pace((0, session_1.underlyingSessionToDuration)(arg0), arg1)); } else if ((0, duration_1.isDuration)(arg0)) { return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), arg1)); } } else { // pace(min, max) if (typeof arg0 === "function" && typeof arg1 === "function") { return wrap(jvmGroups.pace((0, session_1.underlyingSessionToDuration)(arg0), (0, session_1.underlyingSessionToDuration)(arg1))); } else if ((0, duration_1.isDuration)(arg0) && (0, duration_1.isDuration)(arg1)) { return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), (0, duration_1.toJvmDuration)(arg1))); } } } else { // pace(duration) if (typeof arg0 === "string") { return wrap(jvmGroups.pace(arg0)); } else if (typeof arg0 === "function") { return wrap(jvmGroups.pace((0, session_1.underlyingSessionToDuration)(arg0))); } else if ((0, duration_1.isDuration)(arg0)) { return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0))); } } throw Error(`pace() called with invalid arguments ${arg0}, ${arg1}, ${arg2}`); }; exports.paceImpl = paceImpl;