@gatling.io/core 3.11.7 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jest.config.js +5 -0
- package/package.json +3 -3
- package/src/assertions.ts +305 -0
- package/src/body.ts +211 -0
- package/src/checks/builder.ts +14 -0
- package/src/checks/captureGroup.ts +22 -0
- package/src/checks/condition.ts +24 -0
- package/src/checks/final.ts +31 -0
- package/src/checks/find.ts +23 -0
- package/src/checks/index.ts +540 -0
- package/src/checks/jsonOfTypeFind.ts +81 -0
- package/src/checks/jsonOfTypeMultipleFind.ts +84 -0
- package/src/checks/multipleFind.ts +87 -0
- package/src/checks/validate.ts +336 -0
- package/src/closedInjection.ts +182 -0
- package/src/common.ts +3 -0
- package/src/feeders.ts +279 -0
- package/src/filters.ts +49 -0
- package/src/gatlingJvm/app.ts +5 -0
- package/src/gatlingJvm/byteArrays.ts +14 -0
- package/src/gatlingJvm/collections.ts +28 -0
- package/src/globalStore.ts +104 -0
- package/src/index.test.ts +543 -0
- package/src/index.ts +158 -0
- package/src/openInjection.ts +286 -0
- package/src/parameters.ts +38 -0
- package/src/population.ts +105 -0
- package/src/protocol.ts +5 -0
- package/src/scenario.ts +37 -0
- package/src/session.ts +182 -0
- package/src/structure/asLongAs.ts +121 -0
- package/src/structure/asLongAsDuring.ts +337 -0
- package/src/structure/choices.ts +41 -0
- package/src/structure/doIf.ts +140 -0
- package/src/structure/doIfOrElse.ts +160 -0
- package/src/structure/doSwitch.ts +46 -0
- package/src/structure/doSwitchOrElse.ts +61 -0
- package/src/structure/doWhile.ts +53 -0
- package/src/structure/doWhileDuring.ts +337 -0
- package/src/structure/during.ts +182 -0
- package/src/structure/errors.ts +266 -0
- package/src/structure/execs.ts +66 -0
- package/src/structure/feeds.ts +62 -0
- package/src/structure/forEach.ts +68 -0
- package/src/structure/forever.ts +25 -0
- package/src/structure/groups.ts +23 -0
- package/src/structure/index.ts +130 -0
- package/src/structure/jvmStructureBuilder.ts +52 -0
- package/src/structure/on.ts +20 -0
- package/src/structure/paces.ts +156 -0
- package/src/structure/pauses.ts +211 -0
- package/src/structure/randomSwitch.ts +34 -0
- package/src/structure/randomSwitchOrElse.ts +45 -0
- package/src/structure/rendezVous.ts +23 -0
- package/src/structure/repeat.ts +64 -0
- package/src/structure/roundRobinSwitch.ts +34 -0
- package/src/structure/uniformRandomSwitch.ts +34 -0
- package/src/throttling.ts +67 -0
- package/src/utils/duration.ts +28 -0
- package/target/structure/errors.d.ts +70 -10
- package/target/structure/errors.js +29 -8
- package/target/structure/index.d.ts +4 -2
- package/target/structure/index.js +5 -3
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import JvmRendezVous = io.gatling.javaapi.core.pause.RendezVous;
|
|
2
|
+
|
|
3
|
+
export interface RendezVousFunction<T extends RendezVous<T>> {
|
|
4
|
+
/**
|
|
5
|
+
* Make virtual users wait until enough of them reach this point
|
|
6
|
+
*
|
|
7
|
+
* @param users - the number of virtual users that must reach this point
|
|
8
|
+
* @returns a new StructureBuilder
|
|
9
|
+
*/
|
|
10
|
+
(users: number): T;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RendezVous<T extends RendezVous<T>> {
|
|
14
|
+
rendezVous: RendezVousFunction<T>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const rendezVousImpl =
|
|
18
|
+
<J2, J1 extends JvmRendezVous<J2, any>, T extends RendezVous<T>>(
|
|
19
|
+
jvmRendezVous: J1,
|
|
20
|
+
wrap: (wrapped: J2) => T
|
|
21
|
+
): RendezVousFunction<T> =>
|
|
22
|
+
(users: number) =>
|
|
23
|
+
wrap(jvmRendezVous.rendezVous(users));
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { SessionTo, underlyingSessionTo } from "../session";
|
|
2
|
+
import { On, wrapOn } from "./on";
|
|
3
|
+
|
|
4
|
+
import JvmRepeat = io.gatling.javaapi.core.loop.Repeat;
|
|
5
|
+
|
|
6
|
+
export interface RepeatFunction<T extends Repeat<T>> {
|
|
7
|
+
/**
|
|
8
|
+
* Define a loop that will iterate for a given number of times.
|
|
9
|
+
*
|
|
10
|
+
* @param times - the number of iterations
|
|
11
|
+
* @param counterName - the name of the loop counter, as stored in the Session
|
|
12
|
+
* @returns a DSL component for defining the loop content
|
|
13
|
+
*/
|
|
14
|
+
(times: number, counterName?: string): On<T>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Define a loop that will iterate for a given number of times.
|
|
18
|
+
*
|
|
19
|
+
* @param times - the number of iterations, expressed as a Gatling Expression Language String that must evaluate to an integer
|
|
20
|
+
* @param counterName - the name of the loop counter, as stored in the Session
|
|
21
|
+
* @returns a DSL component for defining the loop content
|
|
22
|
+
*/
|
|
23
|
+
(times: string, counterName?: string): On<T>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Define a loop that will iterate for a given number of times.
|
|
27
|
+
*
|
|
28
|
+
* @param times - the number of iterations, expressed as a function
|
|
29
|
+
* @param counterName - the name of the loop counter, as stored in the Session
|
|
30
|
+
* @returns a DSL component for defining the loop content
|
|
31
|
+
*/
|
|
32
|
+
(times: SessionTo<number>, counterName?: string): On<T>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface Repeat<T extends Repeat<T>> {
|
|
36
|
+
repeat: RepeatFunction<T>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const repeatImpl =
|
|
40
|
+
<J2, J1 extends JvmRepeat<J2, any>, T extends Repeat<T>>(
|
|
41
|
+
jvmRepeat: J1,
|
|
42
|
+
wrap: (wrapped: J2) => T
|
|
43
|
+
): RepeatFunction<T> =>
|
|
44
|
+
(times: number | string | SessionTo<number>, counterName?: string) => {
|
|
45
|
+
if (counterName !== undefined) {
|
|
46
|
+
// repeat(times, counterName
|
|
47
|
+
if (typeof times === "number") {
|
|
48
|
+
return wrapOn(jvmRepeat.repeat(times, counterName), wrap);
|
|
49
|
+
} else if (typeof times === "string") {
|
|
50
|
+
return wrapOn(jvmRepeat.repeat(times, counterName), wrap);
|
|
51
|
+
} else {
|
|
52
|
+
return wrapOn(jvmRepeat.repeat(underlyingSessionTo(times), counterName), wrap);
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
// repeat(times)
|
|
56
|
+
if (typeof times === "number") {
|
|
57
|
+
return wrapOn(jvmRepeat.repeat(times), wrap);
|
|
58
|
+
} else if (typeof times === "string") {
|
|
59
|
+
return wrapOn(jvmRepeat.repeat(times), wrap);
|
|
60
|
+
} else {
|
|
61
|
+
return wrapOn(jvmRepeat.repeat(underlyingSessionTo(times)), wrap);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Executable } from "./execs";
|
|
2
|
+
|
|
3
|
+
import JvmRoundRobinSwitch = io.gatling.javaapi.core.condition.RoundRobinSwitch;
|
|
4
|
+
import JvmOn = io.gatling.javaapi.core.condition.RoundRobinSwitch$On;
|
|
5
|
+
|
|
6
|
+
export interface On<T> {
|
|
7
|
+
on(executable: Executable<any>, ...executables: Executable<any>[]): T;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const wrapOn = <J, T>(jvmOn: JvmOn<J>, wrap: (underlying: J) => T): On<T> => ({
|
|
11
|
+
on: (executable: Executable<any>, ...executables: Executable<any>[]): T =>
|
|
12
|
+
wrap(jvmOn.on(executable._underlying, ...executables.map((e) => e._underlying)))
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export interface RoundRobinSwitchFunction<T extends RoundRobinSwitch<T>> {
|
|
16
|
+
/**
|
|
17
|
+
* Execute one of the "choices" in a round-robin fashion. Round-robin is global, not per virtual user.
|
|
18
|
+
*
|
|
19
|
+
* @returns a new StructureBuilder
|
|
20
|
+
*/
|
|
21
|
+
(): On<T>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface RoundRobinSwitch<T extends RoundRobinSwitch<T>> {
|
|
25
|
+
roundRobinSwitch: RoundRobinSwitchFunction<T>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const roundRobinSwitchImpl =
|
|
29
|
+
<J2, J1 extends JvmRoundRobinSwitch<J2, any>, T extends RoundRobinSwitch<T>>(
|
|
30
|
+
jvmRoundRobinSwitch: J1,
|
|
31
|
+
wrap: (wrapped: J2) => T
|
|
32
|
+
): RoundRobinSwitchFunction<T> =>
|
|
33
|
+
() =>
|
|
34
|
+
wrapOn(jvmRoundRobinSwitch.roundRobinSwitch(), wrap);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Executable } from "./execs";
|
|
2
|
+
|
|
3
|
+
import JvmUniformRandomSwitch = io.gatling.javaapi.core.condition.UniformRandomSwitch;
|
|
4
|
+
import JvmOn = io.gatling.javaapi.core.condition.UniformRandomSwitch$On;
|
|
5
|
+
|
|
6
|
+
export interface On<T> {
|
|
7
|
+
on(executable: Executable<any>, ...executables: Executable<any>[]): T;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const wrapOn = <J, T>(jvmOn: JvmOn<J>, wrap: (underlying: J) => T): On<T> => ({
|
|
11
|
+
on: (executable: Executable<any>, ...executables: Executable<any>[]): T =>
|
|
12
|
+
wrap(jvmOn.on(executable._underlying, ...executables.map((e) => e._underlying)))
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export interface UniformRandomSwitchFunction<T extends UniformRandomSwitch<T>> {
|
|
16
|
+
/**
|
|
17
|
+
* Execute one of the "choices" in a random fashion, with each having even weights.
|
|
18
|
+
*
|
|
19
|
+
* @returns a DSL component for defining the "choices"
|
|
20
|
+
*/
|
|
21
|
+
(): On<T>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface UniformRandomSwitch<T extends UniformRandomSwitch<T>> {
|
|
25
|
+
uniformRandomSwitch: UniformRandomSwitchFunction<T>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const uniformRandomSwitchImpl =
|
|
29
|
+
<J2, J1 extends JvmUniformRandomSwitch<J2, any>, T extends UniformRandomSwitch<T>>(
|
|
30
|
+
jvmUniformRandomSwitch: J1,
|
|
31
|
+
wrap: (wrapped: J2) => T
|
|
32
|
+
): UniformRandomSwitchFunction<T> =>
|
|
33
|
+
() =>
|
|
34
|
+
wrapOn(jvmUniformRandomSwitch.uniformRandomSwitch(), wrap);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CoreDsl as JvmCoreDsl } from "@gatling.io/jvm-types";
|
|
2
|
+
|
|
3
|
+
import { Duration, toJvmDuration } from "./utils/duration";
|
|
4
|
+
import { Wrapper } from "./common";
|
|
5
|
+
|
|
6
|
+
import JvmThrottleStep = io.gatling.javaapi.core.ThrottleStep;
|
|
7
|
+
import JvmThrottleStepReachIntermediate = io.gatling.javaapi.core.ThrottleStep$ReachIntermediate;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Bootstrap a new reachRps throttling profile, see {@link ThrottleStepReachIntermediate}
|
|
11
|
+
*
|
|
12
|
+
* @param target - the target requests per second
|
|
13
|
+
* @returns the next DSL step
|
|
14
|
+
*/
|
|
15
|
+
export const reachRps = (target: number): ThrottleStepReachIntermediate =>
|
|
16
|
+
wrapThrottleStepReachIntermediate(JvmCoreDsl.reachRps(target));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Bootstrap a new holdFor throttling profile that limits rps to its current value
|
|
20
|
+
*
|
|
21
|
+
* @param duration - the duration of the plateau in seconds
|
|
22
|
+
* @returns the next DSL step
|
|
23
|
+
*/
|
|
24
|
+
export const holdFor = (duration: Duration): ThrottleStep =>
|
|
25
|
+
wrapThrottleStep(JvmCoreDsl.holdFor(toJvmDuration(duration)));
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Bootstrap a new jumpToRps throttling profile that change the rps limit to a new value
|
|
29
|
+
*
|
|
30
|
+
* @param target - the new limit
|
|
31
|
+
* @returns the next DSL step
|
|
32
|
+
*/
|
|
33
|
+
export const jumpToRps = (target: number): ThrottleStep => wrapThrottleStep(JvmCoreDsl.jumpToRps(target));
|
|
34
|
+
|
|
35
|
+
export interface ThrottleStep extends Wrapper<JvmThrottleStep> {}
|
|
36
|
+
|
|
37
|
+
const wrapThrottleStep = (_underlying: JvmThrottleStep): ThrottleStep => ({
|
|
38
|
+
_underlying
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* DSL step to define the duration of a throttling ramp.
|
|
43
|
+
*/
|
|
44
|
+
export interface ThrottleStepReachIntermediate {
|
|
45
|
+
/**
|
|
46
|
+
* Define the duration of a throttling ramp
|
|
47
|
+
*
|
|
48
|
+
* @param duration - the duration
|
|
49
|
+
* @returns a new ThrottleStep
|
|
50
|
+
*/
|
|
51
|
+
in(duration: Duration): ThrottleStep;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Alias for `in` that's a reserved keyword in Kotlin
|
|
55
|
+
*
|
|
56
|
+
* @param duration - the duration
|
|
57
|
+
* @returns a new ThrottleStep
|
|
58
|
+
*/
|
|
59
|
+
during(duration: Duration): ThrottleStep;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const wrapThrottleStepReachIntermediate = (
|
|
63
|
+
_underlying: JvmThrottleStepReachIntermediate
|
|
64
|
+
): ThrottleStepReachIntermediate => ({
|
|
65
|
+
in: (duration) => wrapThrottleStep(_underlying.in(toJvmDuration(duration))),
|
|
66
|
+
during: (duration) => wrapThrottleStep(_underlying.during(toJvmDuration(duration)))
|
|
67
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Duration as JvmDuration } from "@gatling.io/jvm-types";
|
|
2
|
+
|
|
3
|
+
export type TimeUnit = "milliseconds" | "seconds" | "minutes";
|
|
4
|
+
|
|
5
|
+
export type Duration =
|
|
6
|
+
| number
|
|
7
|
+
| {
|
|
8
|
+
amount: number;
|
|
9
|
+
unit: TimeUnit;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const isDuration = (x: unknown): x is Duration =>
|
|
13
|
+
typeof x === "number" ||
|
|
14
|
+
(typeof x === "object" && typeof (x as any).amount === "number" && typeof (x as any).unit === "string");
|
|
15
|
+
|
|
16
|
+
export const toJvmDuration = (duration: Duration): java.time.Duration => {
|
|
17
|
+
const { amount, unit } = typeof duration === "number" ? { amount: duration, unit: "seconds" } : duration;
|
|
18
|
+
switch (unit) {
|
|
19
|
+
case "milliseconds":
|
|
20
|
+
return JvmDuration.ofMillis(amount);
|
|
21
|
+
case "seconds":
|
|
22
|
+
return JvmDuration.ofSeconds(amount);
|
|
23
|
+
case "minutes":
|
|
24
|
+
return JvmDuration.ofMinutes(amount);
|
|
25
|
+
default:
|
|
26
|
+
return JvmDuration.ofSeconds(amount);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -58,25 +58,26 @@ export interface ExitHereIfFailedFunction<T extends Errors<T>> {
|
|
|
58
58
|
*/
|
|
59
59
|
(): T;
|
|
60
60
|
}
|
|
61
|
-
export interface
|
|
61
|
+
export interface StopLoadGeneratorFunction<T extends Errors<T>> {
|
|
62
62
|
/**
|
|
63
|
-
* Have the virtual user abruptly stop the
|
|
63
|
+
* Have the virtual user abruptly stop the load generator with a successful status
|
|
64
64
|
*
|
|
65
65
|
* @param message - the message, expressed as a Gatling Expression Language String
|
|
66
66
|
* @returns a new StructureBuilder
|
|
67
67
|
*/
|
|
68
68
|
(message: string): T;
|
|
69
69
|
/**
|
|
70
|
-
* Have the virtual user abruptly stop the
|
|
70
|
+
* Have the virtual user abruptly stop the load generator with a successful status
|
|
71
71
|
*
|
|
72
72
|
* @param message - the message, expressed as a function
|
|
73
73
|
* @returns a new StructureBuilder
|
|
74
74
|
*/
|
|
75
75
|
(message: SessionTo<string>): T;
|
|
76
76
|
}
|
|
77
|
-
export interface
|
|
77
|
+
export interface StopLoadGeneratorIfFunction<T extends Errors<T>> {
|
|
78
78
|
/**
|
|
79
|
-
* Have the virtual user abruptly stop the
|
|
79
|
+
* Have the virtual user abruptly stop the load generator with a successful status if a condition
|
|
80
|
+
* is met
|
|
80
81
|
*
|
|
81
82
|
* @param message - the message, expressed as a Gatling Expression Language String
|
|
82
83
|
* @param condition - the condition, expressed as a Gatling Expression Language String
|
|
@@ -84,7 +85,8 @@ export interface StopInjectorIfFunction<T extends Errors<T>> {
|
|
|
84
85
|
*/
|
|
85
86
|
(message: string, condition: string): T;
|
|
86
87
|
/**
|
|
87
|
-
* Have the virtual user abruptly stop the
|
|
88
|
+
* Have the virtual user abruptly stop the load generator with a successful status if a condition
|
|
89
|
+
* is met
|
|
88
90
|
*
|
|
89
91
|
* @param message - the message, expressed as a Gatling Expression Language String
|
|
90
92
|
* @param condition - the condition, expressed as a function
|
|
@@ -92,7 +94,8 @@ export interface StopInjectorIfFunction<T extends Errors<T>> {
|
|
|
92
94
|
*/
|
|
93
95
|
(message: string, condition: SessionTo<boolean>): T;
|
|
94
96
|
/**
|
|
95
|
-
* Have the virtual user abruptly stop the
|
|
97
|
+
* Have the virtual user abruptly stop the load generator with a successful status if a condition
|
|
98
|
+
* is met
|
|
96
99
|
*
|
|
97
100
|
* @param message - the message, expressed as a function
|
|
98
101
|
* @param condition - the condition, expressed as a Gatling Expression Language String
|
|
@@ -100,7 +103,62 @@ export interface StopInjectorIfFunction<T extends Errors<T>> {
|
|
|
100
103
|
*/
|
|
101
104
|
(message: SessionTo<string>, condition: string): T;
|
|
102
105
|
/**
|
|
103
|
-
* Have the virtual user abruptly stop the
|
|
106
|
+
* Have the virtual user abruptly stop the load generator with a successful status if a condition
|
|
107
|
+
* is met
|
|
108
|
+
*
|
|
109
|
+
* @param message - the message, expressed as a function
|
|
110
|
+
* @param condition - the condition, expressed as a function
|
|
111
|
+
* @returns a new StructureBuilder
|
|
112
|
+
*/
|
|
113
|
+
(message: SessionTo<string>, condition: SessionTo<boolean>): T;
|
|
114
|
+
}
|
|
115
|
+
export interface CrashLoadGeneratorFunction<T extends Errors<T>> {
|
|
116
|
+
/**
|
|
117
|
+
* Have the virtual user abruptly stop the load generator with a failed status
|
|
118
|
+
*
|
|
119
|
+
* @param message - the message, expressed as a Gatling Expression Language String
|
|
120
|
+
* @returns a new StructureBuilder
|
|
121
|
+
*/
|
|
122
|
+
(message: string): T;
|
|
123
|
+
/**
|
|
124
|
+
* Have the virtual user abruptly crash the load generator with a failed status
|
|
125
|
+
*
|
|
126
|
+
* @param message - the message, expressed as a function
|
|
127
|
+
* @returns a new StructureBuilder
|
|
128
|
+
*/
|
|
129
|
+
(message: SessionTo<string>): T;
|
|
130
|
+
}
|
|
131
|
+
export interface CrashLoadGeneratorIfFunction<T extends Errors<T>> {
|
|
132
|
+
/**
|
|
133
|
+
* Have the virtual user abruptly crash the load generator with a failed status if a condition is
|
|
134
|
+
* met
|
|
135
|
+
*
|
|
136
|
+
* @param message - the message, expressed as a Gatling Expression Language String
|
|
137
|
+
* @param condition - the condition, expressed as a Gatling Expression Language String
|
|
138
|
+
* @returns a new StructureBuilder
|
|
139
|
+
*/
|
|
140
|
+
(message: string, condition: string): T;
|
|
141
|
+
/**
|
|
142
|
+
* Have the virtual user abruptly crash the load generator with a failed status if a condition is
|
|
143
|
+
* met
|
|
144
|
+
*
|
|
145
|
+
* @param message - the message, expressed as a Gatling Expression Language String
|
|
146
|
+
* @param condition - the condition, expressed as a function
|
|
147
|
+
* @returns a new StructureBuilder
|
|
148
|
+
*/
|
|
149
|
+
(message: string, condition: SessionTo<boolean>): T;
|
|
150
|
+
/**
|
|
151
|
+
* Have the virtual user abruptly crash the load generator with a failed status if a condition is
|
|
152
|
+
* met
|
|
153
|
+
*
|
|
154
|
+
* @param message - the message, expressed as a function
|
|
155
|
+
* @param condition - the condition, expressed as a Gatling Expression Language String
|
|
156
|
+
* @returns a new StructureBuilder
|
|
157
|
+
*/
|
|
158
|
+
(message: SessionTo<string>, condition: string): T;
|
|
159
|
+
/**
|
|
160
|
+
* Have the virtual user abruptly crash the load generator with a failed status if a condition is
|
|
161
|
+
* met
|
|
104
162
|
*
|
|
105
163
|
* @param message - the message, expressed as a function
|
|
106
164
|
* @param condition - the condition, expressed as a function
|
|
@@ -114,7 +172,9 @@ export interface Errors<T extends Errors<T>> {
|
|
|
114
172
|
exitHereIf: ExitHereIfFunction<T>;
|
|
115
173
|
exitHere: ExitHereFunction<T>;
|
|
116
174
|
exitHereIfFailed: ExitHereIfFailedFunction<T>;
|
|
117
|
-
|
|
118
|
-
|
|
175
|
+
stopLoadGenerator: StopLoadGeneratorFunction<T>;
|
|
176
|
+
stopLoadGeneratorIf: StopLoadGeneratorIfFunction<T>;
|
|
177
|
+
crashLoadGenerator: CrashLoadGeneratorFunction<T>;
|
|
178
|
+
crashLoadGeneratorIf: CrashLoadGeneratorIfFunction<T>;
|
|
119
179
|
}
|
|
120
180
|
export declare const errorsImpl: <J2, J1 extends JvmErrors<J2, any>, T extends Errors<T>>(jvmErrors: J1, wrap: (wrapped: J2) => T) => Errors<T>;
|
|
@@ -15,24 +15,45 @@ const errorsImpl = (jvmErrors, wrap) => ({
|
|
|
15
15
|
: jvmErrors.exitHereIf(condition)),
|
|
16
16
|
exitHere: () => wrap(jvmErrors.exitHere()),
|
|
17
17
|
exitHereIfFailed: () => wrap(jvmErrors.exitHereIfFailed()),
|
|
18
|
-
|
|
19
|
-
? jvmErrors.
|
|
20
|
-
: jvmErrors.
|
|
21
|
-
|
|
18
|
+
stopLoadGenerator: (message) => wrap(typeof message === "function"
|
|
19
|
+
? jvmErrors.stopLoadGenerator((0, session_1.underlyingSessionTo)(message))
|
|
20
|
+
: jvmErrors.stopLoadGenerator(message)),
|
|
21
|
+
stopLoadGeneratorIf: (message, condition) => {
|
|
22
22
|
if (typeof message === "function") {
|
|
23
23
|
if (typeof condition === "function") {
|
|
24
|
-
return wrap(jvmErrors.
|
|
24
|
+
return wrap(jvmErrors.stopLoadGeneratorIf((0, session_1.underlyingSessionTo)(message), (0, session_1.underlyingSessionTo)(condition)));
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
return wrap(jvmErrors.
|
|
27
|
+
return wrap(jvmErrors.stopLoadGeneratorIf((0, session_1.underlyingSessionTo)(message), condition));
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
31
|
if (typeof condition === "function") {
|
|
32
|
-
return wrap(jvmErrors.
|
|
32
|
+
return wrap(jvmErrors.stopLoadGeneratorIf(message, (0, session_1.underlyingSessionTo)(condition)));
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
return wrap(jvmErrors.
|
|
35
|
+
return wrap(jvmErrors.stopLoadGeneratorIf(message, condition));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
crashLoadGenerator: (message) => wrap(typeof message === "function"
|
|
40
|
+
? jvmErrors.crashLoadGenerator((0, session_1.underlyingSessionTo)(message))
|
|
41
|
+
: jvmErrors.crashLoadGenerator(message)),
|
|
42
|
+
crashLoadGeneratorIf: (message, condition) => {
|
|
43
|
+
if (typeof message === "function") {
|
|
44
|
+
if (typeof condition === "function") {
|
|
45
|
+
return wrap(jvmErrors.crashLoadGeneratorIf((0, session_1.underlyingSessionTo)(message), (0, session_1.underlyingSessionTo)(condition)));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return wrap(jvmErrors.crashLoadGeneratorIf((0, session_1.underlyingSessionTo)(message), condition));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (typeof condition === "function") {
|
|
53
|
+
return wrap(jvmErrors.crashLoadGeneratorIf(message, (0, session_1.underlyingSessionTo)(condition)));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return wrap(jvmErrors.crashLoadGeneratorIf(message, condition));
|
|
36
57
|
}
|
|
37
58
|
}
|
|
38
59
|
}
|
|
@@ -59,5 +59,7 @@ export declare const tryMax: import("./errors").TryMaxFunction<ChainBuilder>;
|
|
|
59
59
|
export declare const exitHereIf: import("./errors").ExitHereIfFunction<ChainBuilder>;
|
|
60
60
|
export declare const exitHere: import("./errors").ExitHereFunction<ChainBuilder>;
|
|
61
61
|
export declare const exitHereIfFailed: import("./errors").ExitHereIfFailedFunction<ChainBuilder>;
|
|
62
|
-
export declare const
|
|
63
|
-
export declare const
|
|
62
|
+
export declare const stopLoadGenerator: import("./errors").StopLoadGeneratorFunction<ChainBuilder>;
|
|
63
|
+
export declare const stopLoadGeneratorIf: import("./errors").StopLoadGeneratorIfFunction<ChainBuilder>;
|
|
64
|
+
export declare const crashLoadGenerator: import("./errors").CrashLoadGeneratorFunction<ChainBuilder>;
|
|
65
|
+
export declare const crashLoadGeneratorIf: import("./errors").CrashLoadGeneratorIfFunction<ChainBuilder>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.crashLoadGeneratorIf = exports.crashLoadGenerator = exports.stopLoadGeneratorIf = exports.stopLoadGenerator = exports.exitHereIfFailed = exports.exitHere = exports.exitHereIf = exports.tryMax = exports.exitBlockOnFail = exports.roundRobinSwitch = exports.uniformRandomSwitch = exports.randomSwitchOrElse = exports.randomSwitch = exports.doSwitchOrElse = exports.doSwitch = exports.doIfEqualsOrElse = exports.doIfEquals = exports.doIfOrElse = exports.doIf = exports.doWhileDuring = exports.asLongAsDuring = exports.doWhile = exports.asLongAs = exports.forever = exports.during = exports.foreach = exports.repeat = exports.rendezVous = exports.pace = exports.pause = exports.feed = exports.group = exports.exec = exports.percent = exports.onCase = exports.wrapActionBuilder = exports.structureBuilderImpl = void 0;
|
|
4
4
|
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
5
5
|
const execs_1 = require("./execs");
|
|
6
6
|
const groups_1 = require("./groups");
|
|
@@ -92,5 +92,7 @@ exports.tryMax = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder)
|
|
|
92
92
|
exports.exitHereIf = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).exitHereIf;
|
|
93
93
|
exports.exitHere = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).exitHere;
|
|
94
94
|
exports.exitHereIfFailed = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).exitHereIfFailed;
|
|
95
|
-
exports.
|
|
96
|
-
exports.
|
|
95
|
+
exports.stopLoadGenerator = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).stopLoadGenerator;
|
|
96
|
+
exports.stopLoadGeneratorIf = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).stopLoadGeneratorIf;
|
|
97
|
+
exports.crashLoadGenerator = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).crashLoadGenerator;
|
|
98
|
+
exports.crashLoadGeneratorIf = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).crashLoadGeneratorIf;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": "./",
|
|
4
|
+
"rootDir": "src",
|
|
5
|
+
"outDir": "target",
|
|
6
|
+
"lib": ["es2021"],
|
|
7
|
+
"target": "es2021",
|
|
8
|
+
"module": "node16",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"moduleResolution": "node16",
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
"resolveJsonModule": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*.ts"],
|
|
17
|
+
"exclude": ["**/*.test.ts", "jest.config.ts"]
|
|
18
|
+
}
|