Overview
Welcome to NBomber! This tutorial will explore the basics of using NBomber and help you get familiar with it at a high level.
Why we build NBomber and what you can do with it?
- The main reason behind NBomber is to provide a lightweight framework for writing load tests which you can use to test literally any system and simulate any production workload. We wanted to provide only a few abstractions so that we could describe any type of load and still have a simple, intuitive API.
- Another goal is to provide building blocks to validate your POC (proof of concept) projects 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 convert some of your integration tests to load tests easily.
NBomber as a modern framework provides:
- Zero dependencies on protocol (HTTP/WebSockets/AMQP/SQL)
- Zero dependencies on semantic model (Pull/Push)
- Very flexible configuration and dead simple API (F#/C#/JSON)
- Cluster support
- Realtime Reporting
- Plugins support
- CI/CD integration
- Data feed support
Step by step introduction
note
Installation prerequisites
- .NET Core 2.1 SDK or later.
- Visual Studio Code with F# or C# extension installed.
Create console application project
Add NBomber package
Create hello world load test
Let's fist start with an empty hello world example to get more familiar with NBomber. In this example, we will define one simple Step and Scenario which does nothing.
- F#
- C#
Run load test
After running a test you will get a report. Don't get scared, we can skip it for now. Later we will understand how to analyse such reports.
Create simple HTTP load test
Now, let's add HTTP client to test a web server and then run it.
- F#
- C#
Create production-ready HTTP load test
Now, you got a basic understanding of NBomber and ready to move on. This time we will use:
- NBomber.HTTP plugin to simplify defining and handling of HTTP
- NBomber.PingPlugin to add additional reporting
- Specify load simulation
So, we only need to install missed NBomber.Http package (NBomber.PingPlugin is included as part of NBomber, we don't need to install it).
- F#
- C#
Congratulations! You have done it!
Finally, you reach this point! Here you can find additional information which helps you in building real world NBomber tests: