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
- Plugins support
- Realtime reporting
- CI/CD integration
- DataFeed support
#
Step by step introductionnote
Installation prerequisites
- .NET Core 3.1 SDK or later.
- Visual Studio Code with F# or C# extension installed.
#
Create console application project#
Add NBomber package#
Create hello world load testLet's first 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 testAfter 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 (not production-ready)Now, let's add HTTP client to test a web server and then run it.
- F#
- C#
#
Create production-ready HTTP load testNow, 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
- Concurrency
To proceed we only need to install 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: