https://github.com/feature23/rucksack
A simple load testing library for .NET
https://github.com/feature23/rucksack
Last synced: 5 months ago
JSON representation
A simple load testing library for .NET
- Host: GitHub
- URL: https://github.com/feature23/rucksack
- Owner: feature23
- License: mit
- Created: 2024-08-05T23:02:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-12T15:42:09.000Z (almost 2 years ago)
- Last Synced: 2025-08-28T11:03:59.471Z (10 months ago)
- Language: C#
- Size: 68.4 KB
- Stars: 6
- Watchers: 5
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Rucksack
[](https://github.com/feature23/rucksack/actions/workflows/dotnet.yml)
[](https://www.nuget.org/packages/Rucksack)
A simple load testing library for .NET.
---
**What if your day job was contributing to open-source projects and custom AI solutions — and you got paid for it?**
We're hiring remote engineers to contribute to cutting-edge AI and custom software projects. 100% remote, 100% real impact. https://www.feature23.com/careers
## Getting Started
Add Rucksack as a dependency via [NuGet](https://www.nuget.org/packages/Rucksack):
```bash
dotnet add package Rucksack --prerelease
```
Define your options with your preferred strategy, and call `Run`:
```c#
using Rucksack;
using Rucksack.LoadStrategies;
var options = new LoadTestOptions
{
LoadStrategy = new RepeatBurstLoadStrategy(
countPerInterval: 10,
interval: TimeSpan.FromSeconds(1),
totalDuration: TimeSpan.FromSeconds(10)),
};
await LoadTestRunner.Run(async () =>
{
// do something to put load on the system...
await Task.Delay(1000);
}, options);
```
## Load Strategies
There are a couple built-in strategies for generating load, or you can implement `ILoadStrategy` yourself for custom logic.
* `ConstantUserLoadStrategy`: Attempts to maintain a constant concurrent user load at each given check interval until the given duration has passed.
* `OneShotBurstLoadStrategy`: Enqueue the given number of tasks all at once. Does not repeat.
* `RepeatBurstLoadStrategy`: Repeat enqueueing the given count of tasks at each given interval until the given duration has passed.
* `SequentialLoadStrategy`: An aggregate strategy that executes multiple load strategies in order. Great for creating scenarios like step up, then hold steady, then step down.
* `SteppedBurstLoadStrategy`: Enqueue an increasing (or decreasing) burst of tasks in a stepwise manner, regardless of how many are still running.
* `SteppedUserLoadStrategy`: Attempts to maintain an increasing (or decreasing) concurrent user load in a stepwise manner.