webben 1.2206.2614.3134

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global webben --version 1.2206.2614.3134
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local webben --version 1.2206.2614.3134
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=webben&version=1.2206.2614.3134
nuke :add-package webben --version 1.2206.2614.3134

WebBen[chmark]

dotnet build & pack nuget CodeQL license

Cross platform HTTP Server benchmark tool written in .NET 6.0. Declarative and easy to use. Execute test cases and compare the results. Parallelize the execution of test cases.

Runs on MacOS, Linux and Windows. For additional information see all supported platforms.

Installation

dotnet tool install --global webben

Usage samples

webben [command] [options]

Commands:
  config <fileInfo>
  uri <uri>
  analyse, analyze <uri>

Options:
  -v, --verbose                       Enable verbose output
  -e, --export-format <Default|Json>  Export format [default: Default]
  -?, -h, --help                      Show help and usage information

Example:
  webben config <filePath>

Output:
╭─────────────┬───────┬───┬───┬───┬────────┬──────────┬──────────╮
│Name         │Elapsed│NoR│Pll│Err│Avg(ms) │StdDev(ms)│Median(ms)│
├─────────────┼───────┼───┼───┼───┼────────┼──────────┼──────────┤
│get_simple_1 │2.13   │100│100│0  │2,083.83│11.66     │2,080.86  │
│get_simple_2 │2.03   │100│100│0  │2,017.24│7.21      │2,017.62  │
│post_simple_1│2.09   │100│500│0  │2,022.46│5.07      │2,020.69  │
╰─────────────┴───────┴───┴───┴───┴────────┴──────────┴──────────╯
webben uri <uri> [options]

Arguments:
  <uri>  The URI to use.

Options:
  -f, --fetch-content       Whether to fetch the content of the URI.
  -l, --name                Name or label
  -m, --http-method         The HTTP method to use.
  -n, --request-count       The number of requests to make.
  -p, --parallelism         The number of parallelism to use.
  -r, --allow-redirect      Whether to allow redirects.
  -t, --timeout-in-ms       The timeout in milliseconds.
  
Examples:
  webben uri http://localhost:3000
  webben uri http://localhost:3000 -n 10000
  webben uri http://localhost:3000 -p 100 -b 50 -t 5000 -m GET -f false -r false -n 10000

Output:
╭──────────────┬───────┬───┬───┬───┬───────┬──────────┬──────────╮
│Name          │Elapsed│NoR│Pll│Err│Avg(ms)│StdDev(ms)│Median(ms)│
├──────────────┼───────┼───┼───┼───┼───────┼──────────┼──────────┤
│initial_test_1│0.67   │10 │100│0  │456.69 │82.85     │423.60    │
╰──────────────┴───────┴───┴───┴───┴───────┴──────────┴──────────╯

Usage:
  webben analyze <uri> [options]
  webben analyse <uri> [options]

Arguments:
  <uri>  The URI to use.

Options:
  -f, --fetch-content                                      Whether to fetch the content of the URI.
  -r, --allow-redirect                                     Whether to allow redirects.
  -t, --timeout-in-ms <timeout-in-ms>                      The bounded capacity to use.
  -m, --max-trial-count <max-trial-count>                  Iteration count for calculation. See -c
  -c, --calculation-function <Average|Median|P70|P80|P90>  Function for RPS calculation

Examples:
  analyze "https://contoso.com/?q=test"
  analyze "https://contoso.com/?q=test" -c Median  
  analyze "https://contoso.com/?q=test" -m 5 -c P80

Output:
# Analyze result including max requests count per second
╭────────────────┬────────────┬───┬───┬───┬───────┬──────────┬──────────╮
│Name            │Elapsed(sec)│NoR│Pll│Err│Avg(ms)│StdDev(ms)│Median(ms)│
├────────────────┼────────────┼───┼───┼───┼───────┼──────────┼──────────┤
│2206260057093580│0.52        │1  │1  │0  │503.35 │0.00      │503.35    │
│2206260057093580│0.29        │2  │2  │0  │283.28 │1.34      │283.28    │
│2206260057093580│0.29        │4  │4  │0  │282.62 │11.45     │286.21    │
│2206260057093580│0.29        │8  │8  │0  │280.83 │8.95      │284.91    │
│2206260057093580│0.36        │16 │16 │0  │316.97 │19.17     │317.60    │
│2206260057093580│0.71        │32 │32 │0  │658.79 │30.66     │661.04    │
│2206260057093580│0.60        │64 │64 │0  │503.19 │59.68     │492.96    │
│2206260057093580│0.86        │128│128│0  │707.93 │87.33     │723.58    │
│2206260057093580│1.63        │256│256│0  │997.16 │161.11    │997.03    │
│2206260057093580│1.14        │129│129│0  │728.80 │72.92     │724.38    │
╰────────────────┴────────────┴───┴───┴───┴───────┴──────────┴──────────╯
╭──────╮
│MaxRPS│
├──────┤
│ 128  │
╰──────╯

Analyzing session

analyze2

Configuration Sample

{
  "TestCaseConfigurations": [
    {
      "Name": "get_simple_1",
      "Uri": "http://localhost:3000/api/v1/posts/foo"
    },
    {
      "Name": "get_simple_2",
      "Uri": "http://localhost:3000/api/v1/posts/bar"
    },
    {
      "Name": "post_simple_1",
      "Uri": "http://localhost:3000/api/v1/posts",
      "HttpMethod": "POST",
      "NumberOfRequests": 500,
      "FetchContent": false,
      "Parallelism": 500,
      "BoundedCapacity": 500,
      "Headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
      },
      "Cookies": {
        "X-Session-Id": "44c00ac0-eae8-11ec-8fea-0242ac120002"
      },
      "Body": {
        "Content": "{\"name\":\"test\"}",
        "ContentType": "application/json",
        "Encoding": "utf-8"
      }
    }
  ]
}

Usage

./webben config samples/Multiple.json

Output ( Default Formatter )

╭─────────────┬───────┬───┬───┬───┬────────┬────────┬────────╮
│Name         │Elapsed│NoR│Pll│Err│Avg     │P90     │Median  │
├─────────────┼───────┼───┼───┼───┼────────┼────────┼────────┤
│get_simple_1 │2.13   │100│100│0  │2,081.37│2,078.92│2,078.47│
│get_simple_2 │2.03   │100│100│0  │2,015.18│2,025.14│2,013.66│
│post_simple_1│2.08   │100│500│0  │2,019.53│2,023.18│2,019.60│
╰─────────────┴───────┴───┴───┴───┴────────┴────────┴────────╯

Usage

./webben config samples/Multiple.json -e Json

Output ( JSON Formatter )

[{
  "Configuration": {
    "HttpMethod": "GET",
    "RequestCount": 100,
    "Parallelism": 100,
    "UseDefaultCredentials": false,
    "UseCookieContainer": false,
    "MaxBufferSize": 2147483647,
    "Name": "get_simple_1",
    "Uri": "http://localhost:3000/api/v1/posts/foo",
    "FetchContent": false,
    "AllowRedirect": false,
    "TimeoutInMs": 2147483647
  },
  "Timings": [
    "00:00:02.0780162",
    "...",
    "00:00:02.0726471"
  ],
  "Errors": [],
  "Elapsed": "00:00:02.1292561"
},
{
  "Configuration": {
    "HttpMethod": "GET",
    "RequestCount": 100,
    "Parallelism": 100,
    "UseDefaultCredentials": false,
    "UseCookieContainer": false,
    "MaxBufferSize": 2147483647,
    "Name": "get_simple_2",
    "Uri": "http://localhost:3000/api/v1/posts/bar",
    "FetchContent": false,
    "AllowRedirect": false,
    "TimeoutInMs": 2147483647
  },
  "Timings": [
    "00:00:02.0278468",
    "...",
    "00:00:02.0277827"
  ],
  "Errors": [],
  "Elapsed": "00:00:02.0749580"
}]

Other features

Support for authentication, cookie containers, and default credentials. It is possible to use the same credential configuration for multiple test cases. The credential configuration is specified by the CredentialConfigurationKey property.

{
  "CredentialConfigurations": [
    {
      "Key": "cred_1",
      "Provider": "NetworkCredentialProvider",
      "Data": {
        "username": "foo",
        "password": "bar"
      }
    }
  ]
}

Http request headers can be specified.

{
  "TestCaseConfigurations": [
    {
      "Name": "post_simple_1",
      "Uri": "http://localhost:3000",
      "HttpMethod": "POST",
      "NumberOfRequests": 10000,
      "FetchContent": false,
      "Parallelism": 500,
      "BoundedCapacity": 500,
      "Headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
      },
      "Body": {
        "Content": "{\"name\":\"test\"}",
        "ContentType": "application/json",
        "Encoding": "utf-8"
      }
    }
  ]
}

Http request

Http requests created by WebBen are not actually sent to the server. Instead, they are stored in a queue. The queue is processed by multiple threads depending on the parallelism.

POST / HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
Content-Type: application/json; charset=utf-8
Content-Length: 15

{"name":"test"}

WebBen is just a simple tool to generate http requests. You can combine it with other tools to make more complex tasks. For example, you can use WebBen to generate requests and then use another tool to send them to the your backend.

Example

webben uri https://url-to-benchmark.local/pages/1 -e json | \
curl -H "Content-Type: application/json" \
    -X POST \
    --data-binary @- \
    https://your-awesome-backend.local/api/v1/posts
    

POST / HTTP/1.1
Host: your-awesome-backend.local
User-Agent: curl/7.79.1
Accept: */*
Content-Type: application/json
Content-Length: 1042

{
  "Items": [
    {
      "Timings": [
        "00:00:00.5772976",
        "00:00:00.5528780",
        "00:00:00.5148466",
        "00:00:00.5118757",
        "00:00:00.5118554",
        "00:00:00.4524819",
        "00:00:00.5113236",
        "00:00:00.5117843",
        "00:00:00.5148185",
        "00:00:00.4524458"
      ],
      "Errors": [],
      "Elapsed": "00:00:00.5938226",
      "Configuration": {
        "HttpMethod": "GET",
        "RequestCount": 10,
        "Parallelism": 10,
        "UseDefaultCredentials": false,
        "UseCookieContainer": false,
        "MaxBufferSize": 2147483647,
        "Name": "iteration1",
        "Uri": "https://url-to-benchmark.local/pages/1",
        "FetchContent": false,
        "AllowRedirect": true,
        "TimeoutInMs": 2147483647
      },
      "Calculations": {
        "Average": "00:00:00.5111607",
        "StdDev": "00:00:00.0361018",
        "P90": "00:00:00.5772976",
        "P80": "00:00:00.5528780",
        "P70": "00:00:00.5148466",
        "Median": "00:00:00.5118655"
      }
    }
  ]
}

😋 How to contribute

Have an idea? Found a bug? Contributions are always welcome.

  • Open an issue or create a pull request.
  • Share with your friends.
  • Give a Star.

Thanks! ❤️

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.2211.419.313 418 11/4/2022
1.2211.418.5211 360 11/4/2022
1.2211.418.4037 354 11/4/2022
1.2211.418.4002 379 11/4/2022
1.2211.411.5945 360 11/4/2022
1.2211.122.5230 356 11/1/2022
1.2211.122.3327 369 11/1/2022
1.2211.122.2641 362 11/1/2022
1.2211.122.2127 361 11/1/2022
1.2211.122.2011 351 11/1/2022
1.2211.122.940 362 11/1/2022
1.2210.3121.709 372 10/31/2022
1.2210.3121.603 373 10/31/2022
1.2210.3120.4348 371 10/31/2022
1.2210.3009.312 398 10/30/2022
1.2210.3008.4009 387 10/30/2022
1.2210.3008.3932 386 10/30/2022
1.2210.3000.5135 381 10/30/2022
1.2207.1719.5607 418 7/17/2022
1.2207.1719.4842 408 7/17/2022
1.2207.1719.4018 403 7/17/2022
1.2207.1719.3601 397 7/17/2022
1.2207.1717.1135 397 7/17/2022
1.2207.1717.1026 403 7/17/2022
1.2207.1716.5019 401 7/17/2022
1.2207.1710.1228 403 7/17/2022
1.2207.1710.943 386 7/17/2022
1.2207.1710.743 375 7/17/2022
1.2207.1710.130 403 7/17/2022
1.2207.1709.3419 397 7/17/2022
1.2207.1709.3101 419 7/17/2022
1.2207.1709.1851 145 7/17/2022
1.2207.319.4412 411 7/3/2022
1.2207.319.2757 397 7/3/2022
1.2207.319.2536 386 7/3/2022
1.2207.319.2506 398 7/3/2022
1.2207.319.2414 407 7/3/2022
1.2207.209.447 393 7/2/2022
1.2207.209.210 408 7/2/2022
1.2207.208.5949 439 7/2/2022
1.2207.120.3504 423 7/1/2022
1.2206.3018.1730 430 6/30/2022
1.2206.3018.1644 429 6/30/2022
1.2206.3018.1618 406 6/30/2022
1.2206.3018.1429 411 6/30/2022
1.2206.2819.3016 419 6/28/2022
1.2206.2819.2527 409 6/28/2022
1.2206.2819.2348 404 6/28/2022
1.2206.2819.1447 402 6/28/2022
1.2206.2817.1433 399 6/28/2022
1.2206.2816.5427 413 6/28/2022
1.2206.2800.2131 408 6/28/2022
1.2206.2800.1620 409 6/28/2022
1.2206.2723.5934 409 6/28/2022
1.2206.2723.4244 411 6/27/2022
1.2206.2723.2538 437 6/27/2022
1.2206.2723.1543 427 6/27/2022
1.2206.2723.915 399 6/27/2022
1.2206.2723.235 396 6/27/2022
1.2206.2722.5619 404 6/27/2022
1.2206.2722.4834 398 6/27/2022
1.2206.2722.4536 405 6/27/2022
1.2206.2722.4025 419 6/27/2022
1.2206.2722.1854 401 6/27/2022
1.2206.2722.804 401 6/27/2022
1.2206.2722.522 425 6/27/2022
1.2206.2721.5942 409 6/27/2022
1.2206.2718.2430 405 6/27/2022
1.2206.2718.1746 402 6/27/2022
1.2206.2717.3900 408 6/27/2022
1.2206.2717.2625 404 6/27/2022
1.2206.2717.2522 398 6/27/2022
1.2206.2717.2333 387 6/27/2022
1.2206.2717.2111 403 6/27/2022
1.2206.2717.1712 398 6/27/2022
1.2206.2622.2853 395 6/26/2022
1.2206.2621.4808 393 6/26/2022
1.2206.2621.3604 399 6/26/2022
1.2206.2621.2734 388 6/26/2022
1.2206.2621.2407 406 6/26/2022
1.2206.2614.3134 423 6/26/2022
1.2206.2614.2743 412 6/26/2022
1.2206.2605.4418 408 6/26/2022
1.2206.2522.530 392 6/25/2022
1.2206.2510.5031 401 6/25/2022
1.2206.2510.1512 402 6/25/2022
1.2206.2411.5534 414 6/24/2022
1.2206.2220.5030 398 6/22/2022
1.2206.2120.5419 416 6/21/2022
1.2206.2120.5334 405 6/21/2022
1.2206.2120.4940 410 6/21/2022
1.2206.2116.3106 391 6/21/2022
1.2206.2116.2431 390 6/21/2022
1.2206.2116.1858 390 6/21/2022
1.2206.2116.1546 394 6/21/2022
1.2206.2116.805 385 6/21/2022
1.2206.2116.738 384 6/21/2022
1.2206.2115.3114 416 6/21/2022
1.2206.2019.3341 414 6/20/2022
1.2206.2015.5948 395 6/20/2022
1.2206.1920.2529 387 6/19/2022
1.2206.1914.4737 408 6/19/2022
1.2206.1719.5734 402 6/17/2022
1.2206.1719.5336 405 6/17/2022
1.2206.1719.5024 418 6/17/2022
1.2206.1719.1951 424 6/17/2022
1.2206.1710.3934 409 6/17/2022
1.2206.1621.4902 399 6/16/2022
1.2206.1614.3650 411 6/16/2022
1.2206.1614.3540 398 6/16/2022
1.2206.1614.3049 397 6/16/2022
1.2206.1614.2954 406 6/16/2022
1.2206.1614.2802 398 6/16/2022
1.2206.1614.2424 417 6/16/2022
1.2206.1614.1914 427 6/16/2022
1.2206.1612.1148 401 6/16/2022
1.2206.1611.5218 405 6/16/2022
1.2206.1611.5116 406 6/16/2022
1.2206.1611.5058 393 6/16/2022
1.2206.1611.4903 394 6/16/2022
1.2206.1611.4501 392 6/16/2022
1.2206.1522.3746 405 6/15/2022
1.2206.1415.5357 401 6/14/2022
1.2206.1415.4502 408 6/14/2022
1.2206.1415.4435 399 6/14/2022
1.2206.1410.4816 407 6/14/2022
1.2206.1410.4728 401 6/14/2022
1.2206.1410.4239 403 6/14/2022
1.2206.1410.2701 398 6/14/2022
1.2206.1410.2255 139 6/14/2022
1.2206.1410.2145 134 6/14/2022
1.2206.1410.1352 132 6/14/2022
1.2206.1410.925 131 6/14/2022
1.2206.1410.717 135 6/14/2022
1.2206.1409.2228 139 6/14/2022