Skip to content

Commit

Permalink
version 5.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AntyaDev committed Dec 1, 2023
1 parent ab2dbfc commit d568d22
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/Demo/Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="Dapper.Contrib" Version="2.0.78" />
<PackageReference Include="LiteDB" Version="5.0.15" />
<PackageReference Include="NBomber" Version="5.3.0" />
<PackageReference Include="NBomber" Version="5.4.0" />
<PackageReference Include="NBomber.Data" Version="5.0.0" />
<PackageReference Include="NBomber.Http" Version="5.0.0" />
<PackageReference Include="NBomber.Sinks.InfluxDB" Version="5.0.1" />
Expand Down
2 changes: 1 addition & 1 deletion examples/Demo/HelloWorld/HelloWorldExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void Run()
})
.WithoutWarmUp()
.WithLoadSimulations(
Simulation.Inject(rate: 1, interval: TimeSpan.FromSeconds(1), during: TimeSpan.FromSeconds(30)) // keep injecting with rate 150
Simulation.Inject(rate: 150, interval: TimeSpan.FromSeconds(1), during: TimeSpan.FromSeconds(30)) // keep injecting with rate 150
);

NBomberRunner
Expand Down
27 changes: 27 additions & 0 deletions examples/Demo/HelloWorld/LoadSimulation/ScenarioTotalIterations.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using NBomber.CSharp;

namespace Demo.HelloWorld.LoadSimulation;

public class ScenarioTotalIterations
{
public void Run()
{
var scenario = Scenario.Create("hello_world_scenario", async context =>
{
await Task.Delay(1_000);
return Response.Ok();
})
.WithoutWarmUp()
.WithLoadSimulations(
Simulation.IterationsForConstant(copies: 50, iterations: 1000)

// or you can use
// Simulation.IterationsForInject(rate: 50, interval: TimeSpan.FromSeconds(1), iterations: 1000)
);

NBomberRunner
.RegisterScenarios(scenario)
.Run();
}
}
4 changes: 3 additions & 1 deletion examples/Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@
using Demo.HTTP.SimpleBookstore;

// -------------------------------
// -----Hello World examples -----
// ----- Hello World examples -----
// -------------------------------
new HelloWorldExample().Run();
// new ScenarioWithInit().Run();
// new ScenarioWithSteps().Run();
// new StepsShareData().Run();
// new LoggerExample().Run();

// ----- Load Simulations -----
// new ParallelScenarios().Run();
// new ScenarioInjectRate().Run();
// new ScenarioKeepConstant().Run();
// new DelayedScenarioStart().Run();
// new ScenarioTotalIterations().Run();

// new ScenarioWithTimeout().Run();
// new ScenarioWithStepRetry().Run();
Expand Down

0 comments on commit d568d22

Please sign in to comment.