Skip to content

Smrecz/NBomber.Http

 
 

Repository files navigation

Build status NuGet Gitter

NBomber plugin for defining HTTP scenarios

How to install

To install NBomber.Http via NuGet, run this command in NuGet package manager console:

PM> Install-Package NBomber.Http

Documentation

Documentation is located here

Contributing

Would you like to help make NBomber even better? We keep a list of issues that are approachable for newcomers under the good-first-issue label.

Examples

// FSharp example

let httpFactory = HttpClientFactory.create()

let step = Step.create("simple step", clientFactory = httpFactory, execute = fun context ->
	Http.createRequest "GET" "https://nbomber.com"
	|> Http.withHeader "Accept" "text/html"
	|> Http.send context
)

Scenario.create "test_nbomber" [step]
|> Scenario.withLoadSimulations [InjectPerSec(rate = 100, during = seconds 30)]
|> NBomberRunner.registerScenario
|> NBomberRunner.run
// CSharp example

var httpFactory = HttpClientFactory.Create();

var step = Step.Create("simple step", clientFactory: httpFactory, execute: async context =>
{
	var request = Http.CreateRequest("GET", "https://nbomber.com")
					  .WithHeader("Accept", "text/html");

	var response = await Http.Send(request, context);
	return response;
});

var scenario = ScenarioBuilder
		.CreateScenario("test_nbomber", step)
		.WithLoadSimulations(Simulation.InjectPerSec(100, TimeSpan.FromSeconds(30)));

NBomberRunner
	.RegisterScenarios(scenario)
	.Run();

About

NBomber plugin for defining HTTP scenarios.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • F# 42.1%
  • PowerShell 34.0%
  • Shell 13.5%
  • C# 10.4%