@gatling.io/core
Version:
Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
19 lines (18 loc) • 792 B
TypeScript
import { ChoiceWithWeight } from "./choices";
import JvmRandomSwitch = io.gatling.javaapi.core.condition.RandomSwitch;
export interface On<T> {
on(...choices: ChoiceWithWeight[]): T;
}
export interface RandomSwitchFunction<T extends RandomSwitch<T>> {
/**
* Execute one of the "choices" randomly based on their respective weight. Weights are expressed
* in percents so their sum must be <= 100%.
*
* @returns a DSL component for defining the "choices"
*/
(): On<T>;
}
export interface RandomSwitch<T extends RandomSwitch<T>> {
randomSwitch: RandomSwitchFunction<T>;
}
export declare const randomSwitchImpl: <J2, J1 extends JvmRandomSwitch<J2, any>, T extends RandomSwitch<T>>(jvmRandomSwitch: J1, wrap: (wrapped: J2) => T) => RandomSwitchFunction<T>;