Skip to content

Commit

Permalink
extended LoadSimulation by TotalConstant and TotalInject
Browse files Browse the repository at this point in the history
  • Loading branch information
AntyaDev committed Oct 30, 2023
1 parent 4b914a0 commit fcdba70
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions src/NBomber.Contracts/Contracts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ type IScenarioInitContext =
/// NBomber's logger
abstract Logger: ILogger

/// LoadSimulation allows configuring parallelism and workload profiles.
/// LoadSimulation allows configuring parallelism and workload profiles.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
type LoadSimulation =
/// <summary>
/// Adds or removes a given number of Scenario copies(instances) with a linear ramp over a given duration.
/// Each Scenario copy behaves like a long-running thread that runs continually(by specified duration) and will be destroyed when the current load simulation stops.
/// Use it for a smooth ramp up and ramp down.
/// Usually, this simulation type is used to test databases, message brokers, or any other system that works with a static client's pool of connections and reuses them.
/// Usually, this simulation type is used to test databases, message brokers, or any other system that works with a static client's pool of connections and reuses them.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
/// </summary>
/// <param name="copies">The number of concurrent Scenario copies that will be running in parallel.</param>
/// <param name="during">The duration of load simulation.</param>
Expand All @@ -147,18 +149,44 @@ type LoadSimulation =
/// Keeps activated(constantly running) a fixed number of Scenario copies(instances) which executes as many iterations as possible for a specified duration.
/// Each Scenario copy behaves like a long-running thread that runs continually(by specified duration) and will be destroyed when the current load simulation stops.
/// Use it when you need to run and keep a constant amount of Scenario copies for a specific period.
/// Usually, this simulation type is used to test databases, message brokers, or any other system that works with a static client's pool of connections and reuses them.
/// Usually, this simulation type is used to test databases, message brokers, or any other system that works with a static client's pool of connections and reuses them.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
/// </summary>
/// <param name="copies">The number of concurrent Scenario copies that will be running in parallel.</param>
/// <param name="during">The duration of load simulation.</param>
| KeepConstant of copies:int * during:TimeSpan

/// <summary>
/// Keeps activated(constantly running) a fixed number of Scenario copies(instances), which executes as many iterations as possible until a specified iteration count.
/// Each Scenario copy behaves like a long-running thread that runs continually(by specified duration) and will be destroyed when the current load simulation stops.
/// Use it when you need to run and keep a constant amount of Scenario copies for a specific period.
/// Usually, this simulation type is used to test databases, message brokers, or any other system that works with a static client's pool of connections and reuses them.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
/// </summary>
/// <param name="copies">The number of concurrent Scenario copies that will be running in parallel.</param>
/// <param name="iterations">Total number of Scenario iterations to execute across all Scenario copies.</param>
| TotalConstant of copies:int * iterations:int

/// <summary>
/// Injects a given number of Scenario copies(instances) until a specified iteration count.
/// Each Scenario copy behaves like a short-running thread that runs only once and then is destroyed.
/// With this simulation, you control the Scenario injection rate and injection interval.
/// Use it when you want to maintain a constant rate of requests without being affected by the performance of the system you load test.
/// Usually, this simulation type is used to test HTTP API.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
/// </summary>
/// <param name="rate">The injection rate of Scenario copies. It configures how many concurrent copies will be injected at a time.</param>
/// <param name="interval">The injection interval. It configures the interval between injections. </param>
/// <param name="iterations">Total number of Scenario iterations to execute across all Scenario copies.</param>
| TotalInject of rate:int * interval:TimeSpan * iterations:int

/// <summary>
/// Injects a given number of Scenario copies(instances) with a linear ramp over a given duration.
/// Each Scenario copy behaves like a short-running thread that runs only once and then is destroyed.
/// With this simulation, you control the Scenario injection rate and injection interval.
/// Use it for a smooth ramp up and ramp down.
/// Usually, this simulation type is used to test HTTP API.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
/// </summary>
/// <param name="rate">The injection rate of Scenario copies. It configures how many concurrent copies will be injected at a time.</param>
/// <param name="interval">The injection interval. It configures the interval between injections. </param>
Expand All @@ -171,6 +199,7 @@ type LoadSimulation =
/// With this simulation, you control the Scenario injection rate and injection interval.
/// Use it when you want to maintain a constant rate of requests without being affected by the performance of the system you load test.
/// Usually, this simulation type is used to test HTTP API.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
/// </summary>
/// <param name="rate">The injection rate of Scenario copies. It configures how many concurrent copies will be injected at a time.</param>
/// <param name="interval">The injection interval. It configures the interval between injections. </param>
Expand All @@ -183,6 +212,7 @@ type LoadSimulation =
/// With this simulation, you control the Scenario injection rate and injection interval.
/// Use it when you want to maintain a random rate of requests without being affected by the performance of the system you load test.
/// Usually, this simulation type is used to test HTTP API.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
/// </summary>
/// <param name="minRate">The min injection rate of Scenario copies.</param>
/// <param name="maxRate">The max injection rate of Scenario copies.</param>
Expand All @@ -193,6 +223,7 @@ type LoadSimulation =
/// <summary>
/// Introduces Scenario pause simulation for a given duration.
/// It's useful for cases when some Scenario start should be delayed or paused in the middle of execution.
/// Link for info: https://nbomber.com/docs/nbomber/load-simulation
/// </summary>
/// <param name="during">The duration of load simulation.</param>
| Pause of during:TimeSpan
Expand Down

0 comments on commit fcdba70

Please sign in to comment.