@gatling.io/core 0.1.1 → 3.11.2

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 (69) hide show
  1. package/package.json +3 -3
  2. package/target/assertions.d.ts +1 -1
  3. package/target/checks/multipleFind.d.ts +1 -1
  4. package/target/closedInjection.d.ts +94 -1
  5. package/target/closedInjection.js +21 -1
  6. package/target/feeders.d.ts +0 -11
  7. package/target/index.d.ts +17 -2
  8. package/target/index.js +16 -4
  9. package/target/openInjection.d.ts +140 -2
  10. package/target/openInjection.js +46 -1
  11. package/target/population.d.ts +3 -4
  12. package/target/population.js +2 -3
  13. package/target/protocol.d.ts +1 -2
  14. package/target/protocol.js +0 -1
  15. package/target/scenario.d.ts +12 -2
  16. package/target/scenario.js +7 -2
  17. package/target/session.d.ts +89 -0
  18. package/target/session.js +2 -1
  19. package/target/structure/asLongAs.d.ts +1 -2
  20. package/target/structure/asLongAs.js +1 -2
  21. package/target/structure/asLongAsDuring.d.ts +1 -2
  22. package/target/structure/asLongAsDuring.js +1 -2
  23. package/target/structure/choices.d.ts +2 -3
  24. package/target/structure/choices.js +0 -1
  25. package/target/structure/doIf.d.ts +2 -3
  26. package/target/structure/doIf.js +1 -2
  27. package/target/structure/doIfOrElse.d.ts +2 -3
  28. package/target/structure/doIfOrElse.js +1 -2
  29. package/target/structure/doSwitch.d.ts +1 -2
  30. package/target/structure/doSwitch.js +1 -2
  31. package/target/structure/doSwitchOrElse.d.ts +1 -2
  32. package/target/structure/doSwitchOrElse.js +1 -2
  33. package/target/structure/doWhile.d.ts +1 -2
  34. package/target/structure/doWhile.js +1 -2
  35. package/target/structure/doWhileDuring.d.ts +1 -2
  36. package/target/structure/doWhileDuring.js +1 -2
  37. package/target/structure/during.d.ts +1 -2
  38. package/target/structure/during.js +1 -2
  39. package/target/structure/errors.d.ts +1 -2
  40. package/target/structure/errors.js +1 -2
  41. package/target/structure/execs.d.ts +2 -3
  42. package/target/structure/execs.js +0 -1
  43. package/target/structure/feeds.d.ts +1 -2
  44. package/target/structure/feeds.js +1 -2
  45. package/target/structure/forEach.d.ts +1 -2
  46. package/target/structure/forEach.js +1 -2
  47. package/target/structure/forever.d.ts +0 -1
  48. package/target/structure/forever.js +0 -1
  49. package/target/structure/groups.d.ts +0 -1
  50. package/target/structure/groups.js +1 -2
  51. package/target/structure/index.d.ts +0 -1
  52. package/target/structure/index.js +0 -1
  53. package/target/structure/jvmStructureBuilder.d.ts +0 -1
  54. package/target/structure/jvmStructureBuilder.js +0 -1
  55. package/target/structure/paces.d.ts +1 -2
  56. package/target/structure/paces.js +1 -2
  57. package/target/structure/randomSwitch.d.ts +1 -2
  58. package/target/structure/randomSwitch.js +0 -1
  59. package/target/structure/randomSwitchOrElse.d.ts +1 -2
  60. package/target/structure/randomSwitchOrElse.js +0 -1
  61. package/target/structure/rendezVous.d.ts +0 -1
  62. package/target/structure/rendezVous.js +0 -1
  63. package/target/structure/repeat.d.ts +1 -2
  64. package/target/structure/repeat.js +1 -2
  65. package/target/structure/roundRobinSwitch.d.ts +1 -2
  66. package/target/structure/roundRobinSwitch.js +0 -1
  67. package/target/structure/uniformRandomSwitch.d.ts +1 -2
  68. package/target/structure/uniformRandomSwitch.js +0 -1
  69. package/target/throttling.d.ts +5 -3
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@gatling.io/core",
3
- "version": "0.1.1",
3
+ "version": "3.11.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "target/index.js",
6
6
  "types": "target/index.d.ts",
7
7
  "dependencies": {
8
- "@gatling.io/jvm-types": "0.1.1"
8
+ "@gatling.io/jvm-types": "3.11.2"
9
9
  },
10
10
  "devDependencies": {
11
11
  "@types/jest": "29.5.12",
12
12
  "jest": "29.7.0",
13
13
  "prettier": "3.2.5",
14
- "rimraf": "5.0.5",
14
+ "rimraf": "5.0.7",
15
15
  "ts-jest": "29.1.2",
16
16
  "ts-node": "10.9.2",
17
17
  "typescript": "5.4.5"
@@ -1,5 +1,5 @@
1
- import JvmAssertion = io.gatling.javaapi.core.Assertion;
2
1
  import { Wrapper } from "./common";
2
+ import JvmAssertion = io.gatling.javaapi.core.Assertion;
3
3
  /**
4
4
  * Bootstrap a new global assertion that targets stats aggregated on all requests
5
5
  *
@@ -4,7 +4,7 @@ import JvmCheckBuilderMultipleFind = io.gatling.javaapi.core.CheckBuilder$Multip
4
4
  * Step 1 of the Check DSL when the check can return multiple values Immutable, so all methods
5
5
  * return a new occurrence and leave the original unmodified.
6
6
  *
7
- * @typeParam <X> - the type of Java values the check can extract
7
+ * @typeParam X - the type of Java values the check can extract
8
8
  */
9
9
  export interface CheckBuilderMultipleFind<X> extends CheckBuilderValidate<X> {
10
10
  /**
@@ -1,4 +1,3 @@
1
- import "@gatling.io/jvm-types";
2
1
  import { Wrapper } from "./common";
3
2
  import { Duration } from "./utils/duration";
4
3
  import JvmClosedInjectionStep = io.gatling.javaapi.core.ClosedInjectionStep;
@@ -7,27 +6,121 @@ import JvmClosedInjectionStepRamp = io.gatling.javaapi.core.ClosedInjectionStep$
7
6
  import JvmClosedInjectionStepRampTo = io.gatling.javaapi.core.ClosedInjectionStep$RampTo;
8
7
  import JvmClosedInjectionStepStairs = io.gatling.javaapi.core.ClosedInjectionStep$Stairs;
9
8
  import JvmClosedInjectionStepStairsWithTime = io.gatling.javaapi.core.ClosedInjectionStep$StairsWithTime;
9
+ /**
10
+ * An injection profile step for using a closed workload model where you control the concurrent
11
+ * number of users. Only use if your system has a queue limiting entry. Don't use otherwise or your
12
+ * test will not match any production use case.
13
+ *
14
+ * <p>Immutable, so all methods return a new occurrence and leave the original unmodified.
15
+ */
10
16
  export interface ClosedInjectionStep extends Wrapper<JvmClosedInjectionStep> {
11
17
  }
18
+ /**
19
+ * DSL component for building a {@link ClosedInjectionStep} that will inject new users in a way to
20
+ * maintain a constant number of concurrent users for a given duration.
21
+ */
12
22
  export interface ClosedInjectionStepConstant extends Wrapper<JvmClosedInjectionStepConstant> {
23
+ /**
24
+ * Define the duration of the step
25
+ *
26
+ * @param duration - the duration
27
+ * @returns a new ClosedInjectionStep
28
+ */
13
29
  during(duration: Duration): ClosedInjectionStep;
14
30
  }
31
+ /**
32
+ * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp
33
+ * the number of concurrent users for a given duration.
34
+ */
15
35
  export interface ClosedInjectionStepRamp extends Wrapper<JvmClosedInjectionStepRamp> {
36
+ /**
37
+ * Define the target number of concurrent users at the end of the ramp.
38
+ *
39
+ * @param t - the target number
40
+ * @returns a RampConcurrentUsersInjectionTo
41
+ */
16
42
  to(t: number): ClosedInjectionStepRampTo;
17
43
  }
44
+ /**
45
+ * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp
46
+ * the number of concurrent users for a given duration.
47
+ */
18
48
  export interface ClosedInjectionStepRampTo extends Wrapper<JvmClosedInjectionStepRampTo> {
49
+ /**
50
+ * Define the duration of the ramp.
51
+ *
52
+ * @param duration - the duration
53
+ * @returns a complete ClosedInjectionStep
54
+ */
19
55
  during(duration: Duration): ClosedInjectionStep;
20
56
  }
57
+ /**
58
+ * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp
59
+ * the number of concurrent users in a stairs fashion
60
+ */
21
61
  export interface ClosedInjectionStepStairs extends Wrapper<JvmClosedInjectionStepStairs> {
62
+ /**
63
+ * Define the number of levels
64
+ *
65
+ * @param levels - the number of levels in the stairs
66
+ * @returns the next DSL step
67
+ */
22
68
  times(levels: number): ClosedInjectionStepStairsWithTime;
23
69
  }
70
+ /**
71
+ * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp
72
+ * the number of concurrent users in a stairs fashion
73
+ */
24
74
  export interface ClosedInjectionStepStairsWithTime extends Wrapper<JvmClosedInjectionStepStairsWithTime> {
75
+ /**
76
+ * Define the duration of each level
77
+ *
78
+ * @param duration - the duration
79
+ * @returns the next DSL step
80
+ */
25
81
  eachLevelLasting(duration: Duration): ClosedInjectionStepComposite;
26
82
  }
83
+ /**
84
+ * DSL step for building a {@link ClosedInjectionStep} that will inject new users in a way to ramp
85
+ * the number of concurrent users in a stairs fashion
86
+ */
27
87
  export interface ClosedInjectionStepComposite extends ClosedInjectionStep {
88
+ /**
89
+ * Define the initial number of concurrent users (optional)
90
+ *
91
+ * @param startingUsers - the initial number of concurrent users
92
+ * @returns a usable {@link ClosedInjectionStep}
93
+ */
28
94
  startingFrom(startingUsers: number): ClosedInjectionStepComposite;
95
+ /**
96
+ * Define ramps separating levels (optional)
97
+ *
98
+ * @param duration - the duration of the ramps
99
+ * @returns a usable {@link ClosedInjectionStep}
100
+ */
29
101
  separatedByRampsLasting(duration: Duration): ClosedInjectionStepComposite;
30
102
  }
103
+ /**
104
+ * Bootstrap a new closed workload constantConcurrentUsers injection profile, see {@link
105
+ * ClosedInjectionStepConstant}
106
+ *
107
+ * @param users - the number of concurrent users
108
+ * @returns the next DSL step
109
+ */
31
110
  export declare const constantConcurrentUsers: (users: number) => ClosedInjectionStepConstant;
111
+ /**
112
+ * Bootstrap a new closed workload rampConcurrentUsers injection profile, see {@link
113
+ * ClosedInjectionStepRamp}
114
+ *
115
+ * @param from - the number of concurrent users at the start of the ramp
116
+ * @returns the next DSL step
117
+ */
32
118
  export declare const rampConcurrentUsers: (from: number) => ClosedInjectionStepRamp;
119
+ /**
120
+ * Bootstrap a new closed workload incrementConcurrentUsers injection profile, see {@link
121
+ * ClosedInjectionStepStairs}
122
+ *
123
+ * @param usersIncrement - the difference of concurrent users between levels of the stairs
124
+ * @returns the next DSL step
125
+ */
33
126
  export declare const incrementConcurrentUsers: (usersIncrement: number) => ClosedInjectionStepStairs;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.incrementConcurrentUsers = exports.rampConcurrentUsers = exports.constantConcurrentUsers = void 0;
4
- require("@gatling.io/jvm-types");
5
4
  const jvm_types_1 = require("@gatling.io/jvm-types");
6
5
  const duration_1 = require("./utils/duration");
7
6
  const wrapClosedInjectionStep = (_underlying) => ({ _underlying });
@@ -30,9 +29,30 @@ const wrapClosedInjectionStepComposite = (_underlying) => ({
30
29
  startingFrom: (startingUsers) => wrapClosedInjectionStepComposite(_underlying.startingFrom(startingUsers)),
31
30
  separatedByRampsLasting: (duration) => wrapClosedInjectionStepComposite(_underlying.separatedByRampsLasting((0, duration_1.toJvmDuration)(duration)))
32
31
  });
32
+ /**
33
+ * Bootstrap a new closed workload constantConcurrentUsers injection profile, see {@link
34
+ * ClosedInjectionStepConstant}
35
+ *
36
+ * @param users - the number of concurrent users
37
+ * @returns the next DSL step
38
+ */
33
39
  const constantConcurrentUsers = (users) => wrapClosedInjectionStepConstant(jvm_types_1.CoreDsl.constantConcurrentUsers(users));
34
40
  exports.constantConcurrentUsers = constantConcurrentUsers;
41
+ /**
42
+ * Bootstrap a new closed workload rampConcurrentUsers injection profile, see {@link
43
+ * ClosedInjectionStepRamp}
44
+ *
45
+ * @param from - the number of concurrent users at the start of the ramp
46
+ * @returns the next DSL step
47
+ */
35
48
  const rampConcurrentUsers = (from) => wrapClosedInjectionStepRamp(jvm_types_1.CoreDsl.rampConcurrentUsers(from));
36
49
  exports.rampConcurrentUsers = rampConcurrentUsers;
50
+ /**
51
+ * Bootstrap a new closed workload incrementConcurrentUsers injection profile, see {@link
52
+ * ClosedInjectionStepStairs}
53
+ *
54
+ * @param usersIncrement - the difference of concurrent users between levels of the stairs
55
+ * @returns the next DSL step
56
+ */
37
57
  const incrementConcurrentUsers = (usersIncrement) => wrapClosedInjectionStepStairs(jvm_types_1.CoreDsl.incrementConcurrentUsers(usersIncrement));
38
58
  exports.incrementConcurrentUsers = incrementConcurrentUsers;
@@ -57,11 +57,6 @@ export interface FeederBuilder<T> extends Wrapper<JvmFeederBuilder<T>> {
57
57
  shard(): FeederBuilder<T>;
58
58
  }
59
59
  export interface FileBasedFeederBuilder<T> extends FeederBuilder<T> {
60
- queue(): FileBasedFeederBuilder<T>;
61
- random(): FileBasedFeederBuilder<T>;
62
- shuffle(): FileBasedFeederBuilder<T>;
63
- circular(): FileBasedFeederBuilder<T>;
64
- shard(): FileBasedFeederBuilder<T>;
65
60
  /**
66
61
  * Advice to unzip the underlying source because it's a zip or tar file
67
62
  *
@@ -71,12 +66,6 @@ export interface FileBasedFeederBuilder<T> extends FeederBuilder<T> {
71
66
  }
72
67
  export declare const wrapFileBasedFeederBuilder: <T>(_underlying: JvmFeederBuilderFileBased<T>) => FileBasedFeederBuilder<T>;
73
68
  export interface BatchableFeederBuilder<T> extends FileBasedFeederBuilder<T> {
74
- queue(): BatchableFeederBuilder<T>;
75
- random(): BatchableFeederBuilder<T>;
76
- shuffle(): BatchableFeederBuilder<T>;
77
- circular(): BatchableFeederBuilder<T>;
78
- shard(): BatchableFeederBuilder<T>;
79
- unzip(): BatchableFeederBuilder<T>;
80
69
  /**
81
70
  * Force loading the whole data in memory from the underlying source at once. Faster runtime but
82
71
  * slower boot time and higher heap usage.
package/target/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as jvm from "./gatlingJvm/app";
1
+ import "@gatling.io/jvm-types";
2
2
  import { PauseType } from "./structure/pauses";
3
3
  import { Duration } from "./utils/duration";
4
4
  import { SessionTo } from "./session";
@@ -112,4 +112,19 @@ export interface SetUp {
112
112
  }
113
113
  export type SetUpFunction = (...populationBuilders: PopulationBuilder[]) => SetUp;
114
114
  export type Simulation = (setUp: SetUpFunction) => void;
115
- export declare const runSimulation: (simulation: Simulation) => jvm.Simulation;
115
+ export interface SimulationFunction {
116
+ /**
117
+ * Register a Gatling simulation, with the default name (which is "default")
118
+ *
119
+ * @param simulationSetUp - The function setting up the simulation
120
+ */
121
+ (simulationSetUp: Simulation): void;
122
+ /**
123
+ * Register a Gatling simulation
124
+ *
125
+ * @param simulationName - The simulation name (max 100 characters)
126
+ * @param simulationSetUp - The function setting up the simulation
127
+ */
128
+ (simulationName: string, simulationSetUp: Simulation): void;
129
+ }
130
+ export declare const simulation: SimulationFunction;
package/target/index.js CHANGED
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.runSimulation = void 0;
17
+ exports.simulation = void 0;
18
+ require("@gatling.io/jvm-types");
18
19
  const callbacks_1 = require("./gatlingJvm/callbacks");
19
20
  const pauses_1 = require("./structure/pauses");
20
21
  const duration_1 = require("./utils/duration");
@@ -50,7 +51,18 @@ const wrapSetUp = (jvmSetUp) => ({
50
51
  normalPausesWithPercentageDuration: (stdDevPercent) => wrapSetUp(jvmSetUp.normalPausesWithPercentageDuration(stdDevPercent)),
51
52
  pauses: (pauseType) => wrapSetUp(jvmSetUp.pauses((0, pauses_1.toJvmPauseType)(pauseType)))
52
53
  });
53
- const runSimulation = (simulation) => (jvmSetUp) => {
54
- simulation((...populationBuilders) => wrapSetUp(jvmSetUp(populationBuilders.map((p) => p._underlying))));
54
+ const simulation = (arg0, arg1) => {
55
+ const [simulationName, simulationSetUp] = arg1 !== undefined ? [arg0.trim(), arg1] : ["default", arg0];
56
+ if (simulationName.length === 0) {
57
+ throw Error("simulationName must not be empty");
58
+ }
59
+ if ([...simulationName].length > 100) {
60
+ // Count actual characters, not UTF-16 code units as with simulationName.length
61
+ throw Error("simulationName must not exceed 100 characters");
62
+ }
63
+ const JsSimulation = Java.type("io.gatling.js.JsSimulation");
64
+ JsSimulation.registerJsSimulation(simulationName, (jvmSetUp) => {
65
+ simulationSetUp((...populationBuilders) => wrapSetUp(jvmSetUp(populationBuilders.map((p) => p._underlying))));
66
+ });
55
67
  };
56
- exports.runSimulation = runSimulation;
68
+ exports.simulation = simulation;
@@ -1,6 +1,5 @@
1
- import "@gatling.io/jvm-types";
2
- import { Wrapper } from "./common";
3
1
  import { Duration } from "./utils/duration";
2
+ import { Wrapper } from "./common";
4
3
  import JvmOpenInjectionStep = io.gatling.javaapi.core.OpenInjectionStep;
5
4
  import JvmOpenInjectionStepRamp = io.gatling.javaapi.core.OpenInjectionStep$Ramp;
6
5
  import JvmOpenInjectionStepStressPeak = io.gatling.javaapi.core.OpenInjectionStep$StressPeak;
@@ -9,43 +8,182 @@ import JvmOpenInjectionStepRampRate = io.gatling.javaapi.core.OpenInjectionStep$
9
8
  import JvmOpenInjectionStepRampRateDuring = io.gatling.javaapi.core.RampRate$During;
10
9
  import JvmOpenInjectionStepStairs = io.gatling.javaapi.core.OpenInjectionStep$Stairs;
11
10
  import JvmOpenInjectionStepStairsTimes = io.gatling.javaapi.core.Stairs$Times;
11
+ /**
12
+ * An injection profile step for using an open workload model where you control the arrival rate of
13
+ * new users. In 99.99% of the cases, the right choice, over closed workload model.
14
+ *
15
+ * <p>Immutable, so all methods return a new occurrence and leave the original unmodified.
16
+ */
12
17
  export interface OpenInjectionStep extends Wrapper<JvmOpenInjectionStep> {
13
18
  }
14
19
  export interface ConstantRateOpenInjectionStep extends OpenInjectionStep {
15
20
  randomized(): OpenInjectionStep;
16
21
  }
22
+ /**
23
+ * A DSL for creating a {@link OpenInjectionStep} that will inject a stock of users distributed
24
+ * evenly on a given period of time. Strictly equivalent to {@link ConstantRateOpenInjectionStep}
25
+ */
17
26
  export interface OpenInjectionStepRamp extends Wrapper<JvmOpenInjectionStepRamp> {
27
+ /**
28
+ * Define the duration of the ramp
29
+ *
30
+ * @param duration - the ramp duration
31
+ * @returns a new OpenInjectionStep
32
+ */
18
33
  during(duration: Duration): OpenInjectionStep;
19
34
  }
35
+ /**
36
+ * A DSL for creating a {@link OpenInjectionStep} that will inject a stock of users distributed
37
+ * with a <a hreh="https://en.wikipedia.org/wiki/Heaviside_step_function">Heaviside</a>
38
+ * distribution on a given period of time. Strictly equivalent to {@link OpenInjectionStepConstantRate}
39
+ */
20
40
  export interface OpenInjectionStepStressPeak extends Wrapper<JvmOpenInjectionStepStressPeak> {
41
+ /**
42
+ * Define the duration of the Heaviside distribution
43
+ *
44
+ * @param duration - the duration
45
+ * @returns a new OpenInjectionStep
46
+ */
21
47
  during(duration: Duration): OpenInjectionStep;
22
48
  }
49
+ /**
50
+ * A DSL for creating a {@link OpenInjectionStep} that will inject users at a constant rate for a
51
+ * given duration.
52
+ */
23
53
  export interface OpenInjectionStepConstantRate extends Wrapper<JvmOpenInjectionStepConstantRate> {
54
+ /**
55
+ * Define the duration of the step
56
+ *
57
+ * @param duration - the duration
58
+ * @returns a new OpenInjectionStep
59
+ */
24
60
  during(duration: Duration): ConstantRateOpenInjectionStep;
25
61
  }
62
+ /**
63
+ * A DSL for creating a {@link OpenInjectionStep} that will inject users at a rate that will
64
+ * increase linearly for a given duration.
65
+ */
26
66
  export interface OpenInjectionStepRampRate extends Wrapper<JvmOpenInjectionStepRampRate> {
67
+ /**
68
+ * Define the target rate at the end of the ramp
69
+ *
70
+ * @param to - the target rate
71
+ * @returns the next DSL step
72
+ */
27
73
  to(to: number): OpenInjectionStepRampRateDuring;
28
74
  }
75
+ /**
76
+ * A DSL for creating a {@link OpenInjectionStep} that will inject users at a rate that will
77
+ * increase linearly for a given duration.
78
+ */
29
79
  export interface OpenInjectionStepRampRateDuring extends Wrapper<JvmOpenInjectionStepRampRateDuring> {
80
+ /**
81
+ * Define the duration of the ramp
82
+ *
83
+ * @param duration - the duration
84
+ * @returns a new OpenInjectionStep
85
+ */
30
86
  during(duration: Duration): RampRateOpenInjectionStep;
31
87
  }
88
+ /**
89
+ * A special {@link OpenInjectionStep} that supports "randomized".
90
+ */
32
91
  export interface RampRateOpenInjectionStep extends OpenInjectionStep {
33
92
  randomized(): OpenInjectionStep;
34
93
  }
94
+ /**
95
+ * A DSL for creating a {@link OpenInjectionStep} that will inject users with stairs rates.
96
+ */
35
97
  export interface OpenInjectionStepStairs extends Wrapper<JvmOpenInjectionStepStairs> {
98
+ /**
99
+ * Define the number of levels
100
+ *
101
+ * @param levels - the number of levels in the stairs
102
+ * @returns the next DSL step
103
+ */
36
104
  times(levels: number): OpenInjectionStepStairsTimes;
37
105
  }
106
+ /**
107
+ * A DSL for creating a {@link OpenInjectionStep} that will inject users with stairs rates.
108
+ */
38
109
  export interface OpenInjectionStepStairsTimes extends Wrapper<JvmOpenInjectionStepStairsTimes> {
110
+ /**
111
+ * Define the duration of each level
112
+ *
113
+ * @param duration - the duration
114
+ * @returns the next DSL step
115
+ */
39
116
  eachLevelLasting(duration: Duration): OpenInjectionStepStairsComposite;
40
117
  }
118
+ /**
119
+ * A DSL for creating a {@link OpenInjectionStep} that will inject users with stairs rates.
120
+ */
41
121
  export interface OpenInjectionStepStairsComposite extends OpenInjectionStep {
122
+ /**
123
+ * Define the initial number of users per second rate (optional)
124
+ *
125
+ * @param startingRate - the initial rate
126
+ * @returns a usable {@link OpenInjectionStep}
127
+ */
42
128
  startingFrom(startingRate: number): OpenInjectionStepStairsComposite;
129
+ /**
130
+ * Define ramps separating levels (optional)
131
+ *
132
+ * @param duration - the duration
133
+ * @returns a usable {@link OpenInjectionStep}
134
+ */
43
135
  separatedByRampsLasting(duration: Duration): OpenInjectionStepStairsComposite;
44
136
  }
137
+ /**
138
+ * Bootstrap a new open workload rampUsers injection profile, see {@link OpenInjectionStepRamp}
139
+ *
140
+ * @param users - the total number of users to inject
141
+ * @returns the next DSL step
142
+ */
45
143
  export declare const rampUsers: (users: number) => OpenInjectionStepRamp;
144
+ /**
145
+ * Bootstrap a new open workload stress peak injection profile, see {@link
146
+ * OpenInjectionStepStressPeak}
147
+ *
148
+ * @param users - the total number of users to inject
149
+ * @returns the next DSL step
150
+ */
46
151
  export declare const stressPeakUsers: (users: number) => OpenInjectionStepStressPeak;
152
+ /**
153
+ * Inject a bunch of users at the same time.
154
+ *
155
+ * @param users - the number of users to inject
156
+ * @returns a new OpenInjectionStep
157
+ */
47
158
  export declare const atOnceUsers: (users: number) => OpenInjectionStep;
159
+ /**
160
+ * Bootstrap a new open workload constantUsersPerSec injection profile, see {@link
161
+ * OpenInjectionStepConstantRate}
162
+ *
163
+ * @param rate - the users per second rate
164
+ * @returns the next DSL step
165
+ */
48
166
  export declare const constantUsersPerSec: (rate: number) => OpenInjectionStepConstantRate;
167
+ /**
168
+ * Bootstrap a new open workload rampUsersPerSec injection profile, see {@link
169
+ * OpenInjectionStepRampRate}
170
+ *
171
+ * @param rate - the users per second start rate
172
+ * @returns the next DSL step
173
+ */
49
174
  export declare const rampUsersPerSec: (rate: number) => OpenInjectionStepRampRate;
175
+ /**
176
+ * Don't inject any new user for a given duration
177
+ *
178
+ * @param duration - the duration
179
+ * @returns a new OpenInjectionStep
180
+ */
50
181
  export declare const nothingFor: (duration: Duration) => OpenInjectionStep;
182
+ /**
183
+ * Bootstrap a new open workload incrementUsersPerSec injection profile, see {@link
184
+ * OpenInjectionStepStairs}
185
+ *
186
+ * @param rateIncrement - the difference of users per second rate between levels of the stairs
187
+ * @returns the next DSL step
188
+ */
51
189
  export declare const incrementUsersPerSec: (rateIncrement: number) => OpenInjectionStepStairs;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.incrementUsersPerSec = exports.nothingFor = exports.rampUsersPerSec = exports.constantUsersPerSec = exports.atOnceUsers = exports.stressPeakUsers = exports.rampUsers = void 0;
4
- require("@gatling.io/jvm-types");
5
4
  const jvm_types_1 = require("@gatling.io/jvm-types");
6
5
  const duration_1 = require("./utils/duration");
7
6
  const wrapOpenInjectionStep = (_underlying) => ({ _underlying });
@@ -46,17 +45,63 @@ const wrapOpenInjectionStepStairsComposite = (_underlying) => ({
46
45
  startingFrom: (startingRate) => wrapOpenInjectionStepStairsComposite(_underlying.startingFrom(startingRate)),
47
46
  separatedByRampsLasting: (duration) => wrapOpenInjectionStepStairsComposite(_underlying.separatedByRampsLasting((0, duration_1.toJvmDuration)(duration)))
48
47
  });
48
+ /**
49
+ * Bootstrap a new open workload rampUsers injection profile, see {@link OpenInjectionStepRamp}
50
+ *
51
+ * @param users - the total number of users to inject
52
+ * @returns the next DSL step
53
+ */
49
54
  const rampUsers = (users) => wrapOpenInjectionStepRamp(jvm_types_1.CoreDsl.rampUsers(users));
50
55
  exports.rampUsers = rampUsers;
56
+ /**
57
+ * Bootstrap a new open workload stress peak injection profile, see {@link
58
+ * OpenInjectionStepStressPeak}
59
+ *
60
+ * @param users - the total number of users to inject
61
+ * @returns the next DSL step
62
+ */
51
63
  const stressPeakUsers = (users) => wrapOpenInjectionStepStressPeak(jvm_types_1.CoreDsl.stressPeakUsers(users));
52
64
  exports.stressPeakUsers = stressPeakUsers;
65
+ /**
66
+ * Inject a bunch of users at the same time.
67
+ *
68
+ * @param users - the number of users to inject
69
+ * @returns a new OpenInjectionStep
70
+ */
53
71
  const atOnceUsers = (users) => wrapOpenInjectionStep(jvm_types_1.CoreDsl.atOnceUsers(users));
54
72
  exports.atOnceUsers = atOnceUsers;
73
+ /**
74
+ * Bootstrap a new open workload constantUsersPerSec injection profile, see {@link
75
+ * OpenInjectionStepConstantRate}
76
+ *
77
+ * @param rate - the users per second rate
78
+ * @returns the next DSL step
79
+ */
55
80
  const constantUsersPerSec = (rate) => wrapOpenInjectionStepConstantRate(jvm_types_1.CoreDsl.constantUsersPerSec(rate));
56
81
  exports.constantUsersPerSec = constantUsersPerSec;
82
+ /**
83
+ * Bootstrap a new open workload rampUsersPerSec injection profile, see {@link
84
+ * OpenInjectionStepRampRate}
85
+ *
86
+ * @param rate - the users per second start rate
87
+ * @returns the next DSL step
88
+ */
57
89
  const rampUsersPerSec = (rate) => wrapOpenInjectionStepRampRate(jvm_types_1.CoreDsl.rampUsersPerSec(rate));
58
90
  exports.rampUsersPerSec = rampUsersPerSec;
91
+ /**
92
+ * Don't inject any new user for a given duration
93
+ *
94
+ * @param duration - the duration
95
+ * @returns a new OpenInjectionStep
96
+ */
59
97
  const nothingFor = (duration) => wrapOpenInjectionStep(jvm_types_1.CoreDsl.nothingFor((0, duration_1.toJvmDuration)(duration)));
60
98
  exports.nothingFor = nothingFor;
99
+ /**
100
+ * Bootstrap a new open workload incrementUsersPerSec injection profile, see {@link
101
+ * OpenInjectionStepStairs}
102
+ *
103
+ * @param rateIncrement - the difference of users per second rate between levels of the stairs
104
+ * @returns the next DSL step
105
+ */
61
106
  const incrementUsersPerSec = (rateIncrement) => wrapOpenInjectionStepStairs(jvm_types_1.CoreDsl.incrementUsersPerSec(rateIncrement));
62
107
  exports.incrementUsersPerSec = incrementUsersPerSec;
@@ -1,11 +1,10 @@
1
- import "@gatling.io/jvm-types";
2
- import JvmPopulationBuilder = io.gatling.javaapi.core.PopulationBuilder;
1
+ import { Duration } from "./utils/duration";
2
+ import { PauseType } from "./structure/pauses";
3
3
  import { Wrapper } from "./common";
4
4
  import { ProtocolBuilder } from "./protocol";
5
5
  import { SessionTo } from "./session";
6
- import { Duration } from "./utils/duration";
7
- import { PauseType } from "./structure/pauses";
8
6
  import { ThrottleStep } from "./throttling";
7
+ import JvmPopulationBuilder = io.gatling.javaapi.core.PopulationBuilder;
9
8
  /**
10
9
  * A builder for a Population = a Scenario + an injection profile.
11
10
  *
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.wrapPopulationBuilder = void 0;
4
- require("@gatling.io/jvm-types");
5
- const session_1 = require("./session");
4
+ const callbacks_1 = require("./gatlingJvm/callbacks");
6
5
  const duration_1 = require("./utils/duration");
7
6
  const pauses_1 = require("./structure/pauses");
8
- const callbacks_1 = require("./gatlingJvm/callbacks");
7
+ const session_1 = require("./session");
9
8
  const wrapPopulationBuilder = (_underlying) => ({
10
9
  _underlying,
11
10
  protocols: (...protocols) => (0, exports.wrapPopulationBuilder)(_underlying.protocols(protocols.map((p) => p._underlying))),
@@ -1,5 +1,4 @@
1
- import "@gatling.io/jvm-types";
2
- import JvmProtocolBuilder = io.gatling.javaapi.core.ProtocolBuilder;
3
1
  import { Wrapper } from "./common";
2
+ import JvmProtocolBuilder = io.gatling.javaapi.core.ProtocolBuilder;
4
3
  export interface ProtocolBuilder extends Wrapper<JvmProtocolBuilder> {
5
4
  }
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- require("@gatling.io/jvm-types");
@@ -1,10 +1,20 @@
1
- import "@gatling.io/jvm-types";
2
- import { StructureBuilder } from "./structure";
3
1
  import { ClosedInjectionStep } from "./closedInjection";
4
2
  import { OpenInjectionStep } from "./openInjection";
5
3
  import { PopulationBuilder } from "./population";
4
+ import { StructureBuilder } from "./structure";
5
+ /**
6
+ * Javascript wrapper of a Java ScenarioBuilder.
7
+ *
8
+ * <p>Immutable, so all methods return a new occurrence and leave the original unmodified.
9
+ */
6
10
  export interface ScenarioBuilder extends StructureBuilder<ScenarioBuilder> {
7
11
  injectOpen(...steps: OpenInjectionStep[]): PopulationBuilder;
8
12
  injectClosed(...steps: ClosedInjectionStep[]): PopulationBuilder;
9
13
  }
14
+ /**
15
+ * Create a new immutable Scenario builder
16
+ *
17
+ * @param name - the scenario name
18
+ * @returns a new Scenario builder
19
+ */
10
20
  export declare const scenario: (name: string) => ScenarioBuilder;
@@ -1,15 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.scenario = void 0;
4
- require("@gatling.io/jvm-types");
5
4
  const jvm_types_1 = require("@gatling.io/jvm-types");
6
- const structure_1 = require("./structure");
7
5
  const population_1 = require("./population");
6
+ const structure_1 = require("./structure");
8
7
  const wrapScenarioBuilder = (jvmScenarioBuilder) => ({
9
8
  injectOpen: (...steps) => (0, population_1.wrapPopulationBuilder)(jvmScenarioBuilder.injectOpen(steps.map((s) => s._underlying))),
10
9
  injectClosed: (...steps) => (0, population_1.wrapPopulationBuilder)(jvmScenarioBuilder.injectClosed(steps.map((s) => s._underlying))),
11
10
  ...(0, structure_1.structureBuilderImpl)(jvmScenarioBuilder, wrapScenarioBuilder)
12
11
  });
12
+ /**
13
+ * Create a new immutable Scenario builder
14
+ *
15
+ * @param name - the scenario name
16
+ * @returns a new Scenario builder
17
+ */
13
18
  const scenario = (name) => {
14
19
  const jvmScenarioBuilder = jvm_types_1.CoreDsl.scenario(name);
15
20
  return wrapScenarioBuilder(jvmScenarioBuilder);