Skip to content

NBomber v4.0.0-beta6

Compare
Choose a tag to compare
@AntyaDev AntyaDev released this 17 Nov 08:06
· 174 commits to dev since this release

NBomber

Type inference improvement for C# Response Api
Improved data transfer tracking for scenario Global Info

NBomber.Cluster

Fixed issue with concurrent NATS message handling
Added support to set cluster-id via CLI

Now you can use --cluster-id=mycluster

Also, the API method was added:
NBomberClusterRunner.withClusterId "mycluster"

NBomber.HTTP

Added Http Builder API

let run () =

    use httpClient = new HttpClient()

    Scenario.create("http_scenario", fun context -> task {

        let! response =
            Http.createRequest "GET" "https://nbomber.com"
            |> Http.withHeader "Accept" "text/html"
            |> Http.withBody (new StringContent("{ some JSON }"))
            |> Http.send httpClient

        return response
    })
    |> Scenario.withoutWarmUp
    |> Scenario.withLoadSimulations [InjectPerSec(rate = 100, during = seconds 30)]
    |> NBomberRunner.registerScenario
    |> NBomberRunner.run
public void Run()
{
    using var httpClient = new HttpClient();

    var scenario = Scenario.Create("http_scenario", async context =>
    {
        var request =
            Http.CreateRequest("GET", "https://nbomber.com")
                .WithHeader("Accept", "text/html")
                .WithBody(new StringContent("{ some JSON }"));

        var response = await Http.Send(httpClient, request);

        return response;
    })
    .WithoutWarmUp()
    .WithLoadSimulations(Simulation.InjectPerSec(100, TimeSpan.FromSeconds(30)));

    NBomberRunner
        .RegisterScenarios(scenario)
        .Run();
}