NBomber is an open-source .NET framework, the open-source protocol is Apache 2.0, NBomber is used to load test a variety of services, including web, message queues, databases, etc. NBomber version 2.0 was released in May this year. NBomber is similar to JMeter, but the difference from JMeter is that NBomber expresses test scenarios through F#/C#/JSON code.
The main reason behind NBomber is to provide a lightweight framework for writing load tests that you can use to test any system and simulate any production workload. We just want to provide some abstraction so that we can describe any type of payload and still have a simple, intuitive API. Another goal is to provide building blocks to validate your POC (proof of concept) project by applying any complex load distribution. With NBomber, you can test any PULL or PUSH system (HTTP, WebSockets, GraphQl, gRPC, SQL Databse, MongoDb, Redis, etc.). With NBomber, you can easily convert some integration tests into load tests.
NBomber as a modern framework provides:
- Zero-dependency protocols (HTTP/WebSockets/AMQP/SQL)
- Zero dependency on semantic models (Pull/Push)
- Very flexible configuration and very simple API (F#/C#/JSON)
- Cluster support
- Real-time reporting
- CI/CD integration
- Data feed support
GitHub address:The hyperlink login is visible. Document address:The hyperlink login is visible.
First, create a new .NET Core 3.1 console project and use nuget to install the following package:
To get the most performance from NBomber, you should edit your project settings with the following configuration:
Garbage collection settings GarbageCollection should switch to server and concurrency mode:
Full project setup:
Test sending a GET request to this site and set a custom request header with the following code:
The program will automatically generate a test report under the bin\Debug\netcoreapp3.1\reports\ directory, as shown in the figure below:
(End)
|