@gatling.io/core 3.13.103 → 3.13.104-M10

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.
Files changed (61) hide show
  1. package/package.json +4 -4
  2. package/jest.config.js +0 -5
  3. package/src/assertions.ts +0 -305
  4. package/src/body.ts +0 -211
  5. package/src/checks/builder.ts +0 -14
  6. package/src/checks/captureGroup.ts +0 -22
  7. package/src/checks/condition.ts +0 -24
  8. package/src/checks/final.ts +0 -31
  9. package/src/checks/find.ts +0 -23
  10. package/src/checks/index.ts +0 -540
  11. package/src/checks/jsonOfTypeFind.ts +0 -81
  12. package/src/checks/jsonOfTypeMultipleFind.ts +0 -84
  13. package/src/checks/multipleFind.ts +0 -87
  14. package/src/checks/validate.ts +0 -336
  15. package/src/closedInjection.ts +0 -182
  16. package/src/common.ts +0 -3
  17. package/src/feeders.ts +0 -279
  18. package/src/filters.ts +0 -49
  19. package/src/gatlingJvm/app.ts +0 -5
  20. package/src/gatlingJvm/byteArrays.ts +0 -14
  21. package/src/gatlingJvm/collections.ts +0 -28
  22. package/src/gatlingJvm/resources.ts +0 -11
  23. package/src/globalStore.ts +0 -104
  24. package/src/index.test.ts +0 -543
  25. package/src/index.ts +0 -160
  26. package/src/openInjection.ts +0 -286
  27. package/src/parameters.ts +0 -38
  28. package/src/population.ts +0 -105
  29. package/src/protocol.ts +0 -5
  30. package/src/scenario.ts +0 -37
  31. package/src/session.ts +0 -182
  32. package/src/structure/asLongAs.ts +0 -121
  33. package/src/structure/asLongAsDuring.ts +0 -337
  34. package/src/structure/choices.ts +0 -41
  35. package/src/structure/doIf.ts +0 -140
  36. package/src/structure/doIfOrElse.ts +0 -160
  37. package/src/structure/doSwitch.ts +0 -46
  38. package/src/structure/doSwitchOrElse.ts +0 -61
  39. package/src/structure/doWhile.ts +0 -53
  40. package/src/structure/doWhileDuring.ts +0 -337
  41. package/src/structure/during.ts +0 -182
  42. package/src/structure/errors.ts +0 -266
  43. package/src/structure/execs.ts +0 -66
  44. package/src/structure/feeds.ts +0 -62
  45. package/src/structure/forEach.ts +0 -68
  46. package/src/structure/forever.ts +0 -25
  47. package/src/structure/groups.ts +0 -23
  48. package/src/structure/index.ts +0 -130
  49. package/src/structure/jvmStructureBuilder.ts +0 -52
  50. package/src/structure/on.ts +0 -20
  51. package/src/structure/paces.ts +0 -156
  52. package/src/structure/pauses.ts +0 -211
  53. package/src/structure/randomSwitch.ts +0 -34
  54. package/src/structure/randomSwitchOrElse.ts +0 -45
  55. package/src/structure/rendezVous.ts +0 -23
  56. package/src/structure/repeat.ts +0 -64
  57. package/src/structure/roundRobinSwitch.ts +0 -34
  58. package/src/structure/uniformRandomSwitch.ts +0 -34
  59. package/src/throttling.ts +0 -67
  60. package/src/utils/duration.ts +0 -28
  61. package/tsconfig.json +0 -18
@@ -1,23 +0,0 @@
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));
@@ -1,64 +0,0 @@
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
- };
@@ -1,34 +0,0 @@
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);
@@ -1,34 +0,0 @@
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);
package/src/throttling.ts DELETED
@@ -1,67 +0,0 @@
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
- });
@@ -1,28 +0,0 @@
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
- };
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
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
- }