Skip to content

Instantly share code, notes, and snippets.

@kshyju
Created May 3, 2025 03:29
Show Gist options
  • Save kshyju/d4f70b274725053f06d608d94507318a to your computer and use it in GitHub Desktop.
Save kshyju/d4f70b274725053f06d608d94507318a to your computer and use it in GitHub Desktop.
variables:
headers:
none: ''
plaintext: '--header "Accept: text/plain,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7" --header "Connection: keep-alive"'
html: '--header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" --header "Connection: keep-alive"'
json: '--header "Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7" --header "Connection: keep-alive"'
connectionclose: '--header "Connection: close"'
presetHeaders: none
jobs:
bombardier:
source:
repository: https://github.com/dotnet/crank.git
branchOrCommit: main
project: src/Microsoft.Crank.Jobs.Bombardier/Microsoft.Crank.Jobs.Bombardier.csproj
sourceKey: bombardier
noBuild: true
readyStateText: Bombardier Client
waitForExit: true
variables:
connections: 512
warmup: 15
duration: 60
requests: 0
timeout: 2
rate: 0
transport: fasthttp # | http1 | http2
serverScheme: http
serverAddress: localhost
serverPort: 5000
path:
body: # request body
bodyFile: # path or url for a file to use as the body content
certFile: # path or url for a file to use as the cert content
keyFile: # path or url for a file to use as the key content
stream: # specify whether to stream body
verb: # GET when nothing is specified
customHeaders: [ ] # list of headers with the format: '<name1>: <value1>', e.g. [ 'content-type: application/json' ]
arguments: "-c {{connections}} -w {{warmup}} -d {{duration}} -n {{requests}} -t {{timeout}}s --insecure -l {% if rate != 0 %} --rate {{ rate }} {% endif %} {% if transport != blank %} --{{ transport}} {% endif %} {{headers[presetHeaders]}} {% for h in customHeaders %}{% assign s = h | split : ':' %}--header \"{{ s[0] }}: {{ s[1] | strip }}\" {% endfor %} {% if serverUri == blank %} {{serverScheme}}://{{serverAddress}}:{{serverPort}}{{path}} {% else %} {{serverUri}}:{{serverPort}}{{path}} {% endif %} {% if bodyFile != blank %} -f {{bodyFile}} {% endif %} {% if certFile != blank %} --cert {{certFile}} {% endif %} {% if keyFile != blank %} --key {{keyFile}} {% endif %} {% if stream != blank %} -s {% endif %} {% if body != blank %} -b {{body}} {% endif %} {% if verb != blank %} -m {{verb}} {% endif %}"
onConfigure:
# - job.timeout = Number(job.variables.duration) + Number(job.variables.warmup) + 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment