ProductPromotion
Logo

Rust

made by https://0x3d.site

GitHub - fcsonline/drill: Drill is an HTTP load testing application written in Rust
Drill is an HTTP load testing application written in Rust - fcsonline/drill
Visit Site

GitHub - fcsonline/drill: Drill is an HTTP load testing application written in Rust

GitHub - fcsonline/drill: Drill is an HTTP load testing application written in Rust

Drill

Drill is a HTTP load testing application written in Rust. The main goal for this project is to build a really lightweight tool as alternative to other that require JVM and other stuff.

You can write benchmark files, in YAML format, describing all the stuff you want to test.

It was inspired by Ansible syntax because it is really easy to use and extend.

Here is an example for benchmark.yml:

---

concurrency: 4
base: 'http://localhost:9000'
iterations: 5
rampup: 2

plan:
  - name: Include comments
    include: comments.yml

  - name: Fetch users
    request:
      url: /api/users.json

  - name: Fetch organizations
    request:
      url: /api/organizations

  - name: Fetch account
    request:
      url: /api/account
    assign: foo

  - name: Fetch manager user
    request:
      url: /api/users/{{ foo.body.manager_id }}

  - name: Assert request response code
    assert:
      key: foo.status
      value: 200

  - name: Assign values
    assign:
      key: bar
      value: "2"

  - name: Assert values
    assert:
      key: bar
      value: "2"

  - name: Fetch user from assign
    request:
      url: /api/users/{{ bar }}

  - name: Fetch some users
    request:
      url: /api/users/{{ item }}
    with_items:
      - 70
      - 73
      - 75

  - name: Tagged user request
    request:
      url: /api/users/70
    tags:
      - tag_user

  - name: Fetch some users by hash
    request:
      url: /api/users/{{ item.id }}
    with_items:
      - { id: 70 }
      - { id: 73 }
      - { id: 75 }

  - name: Fetch some users by range, index {{ index }}
    request:
      url: /api/users/{{ item }}
    with_items_range:
      start: 70
      step: 5
      stop: 75

  - name: Fetch some users from CSV, index {{ index }}
    request:
      url: /api/users/contacts/{{ item.id }}
    with_items_from_csv: ./fixtures/users.csv
    shuffle: true

  - name: POST some crafted JSONs stored in CSV, index {{ index }}
    request:
      url: /api/transactions
      method: POST
      body: '{{ item.txn }}'
      headers:
        Content-Type: 'application/json'
    with_items_from_csv:
      file_name: ./fixtures/transactions.csv
      quote_char: "\'"

  - name: Fetch no relative url
    request:
      url: http://localhost:9000/api/users.json

  - name: Interpolate environment variables
    request:
      url: http://localhost:9000/api/{{ EDITOR }}

  - name: Support for POST method
    request:
      url: /api/users
      method: POST
      body: foo=bar&arg={{ bar }}

  - name: Login user
    request:
      url: /login?user=example&password=3x4mpl3

  - name: Fetch counter
    request:
      url: /counter
    assign: memory

  - name: Fetch counter
    request:
      url: /counter
    assign: memory

  - name: Fetch endpoint
    request:
      url: /?counter={{ memory.body.counter }}

  - name: Reset counter
    request:
      method: DELETE
      url: /

  - name: Exec external commands
    exec:
      command: "echo '{{ foo.body }}' | jq .phones[0] | tr -d '\"'"
    assign: baz

  - name: Custom headers
    request:
      url: /admin
      headers:
        Authorization: Basic aHR0cHdhdGNoOmY=
        X-Foo: Bar
        X-Bar: Bar {{ memory.headers.token }}

  - name: One request with a random item
    request:
      url: /api/users/{{ item }}
    with_items:
      - 70
      - 73
      - 75
    shuffle: true
    pick: 1

  - name: Three requests with random items from a range
    request:
      url: /api/users/{{ item }}
    with_items_range:
      start: 1
      stop: 1000
    shuffle: true
    pick: 3

As you can see, you can play with interpolations in different ways. This will let you specify a benchmark with different requests and dependencies between them.

If you want to know more about the benchmark file syntax, read this

Install

Right now, the easiest way to get drill is to go to the latest release page and download the binary file for your platform.

Another way to install drill, if you have Rust available in your system, is with cargo:

cargo install drill
drill --benchmark benchmark.yml --stats

or download the source code and compile it:

git clone [email protected]:fcsonline/drill.git && cd drill
cargo build --release
./target/release/drill --benchmark benchmark.yml --stats

Dependencies

OpenSSL is needed in order to compile Drill, whether it is through cargo install or when compiling from source with cargo build.

Depending on your platform, the name of the dependencies may differ.

Linux

Install libssl-dev and pkg-config packages with your favorite package manager (if libssl-dev is not found, try other names like openssl or openssl-devel).

macOS

First, install the Homebrew package manager.

And then install openssl with Homebrew.

Windows

First, install vcpkg.

And then run vcpkg install openssl:x64-windows-static-md.

Demo

demo

Features

This is the list of all features supported by the current version of drill:

  • Concurrency: run your benchmarks choosing the number of concurrent iterations.
  • Multi iterations: specify the number of iterations you want to run the benchmark.
  • Ramp-up: specify the amount of time, in seconds, that it will take drill to start all iterations.
  • Delay: introduce controlled delay between requests. Example: delay.yml
  • Dynamic urls: execute requests with dynamic interpolations in the url, like /api/users/{{ item }}
  • Dynamic headers: execute requests with dynamic headers. Example: headers.yml
  • Interpolate environment variables: set environment variables, like /api/users/{{ EDITOR }}
  • Executions: execute remote commands with test plan data.
  • Assertions: assert values during the test plan. Example: iterations.yml
  • Request dependencies: create dependencies between requests with assign and url interpolations.
  • Split files: organize your benchmarks in multiple files and include them.
  • CSV support: read CSV files and build N requests fill dynamic interpolations with CSV data.
  • HTTP methods: build request with different http methods like GET, POST, PUT, PATCH, HEAD or DELETE.
  • Cookie support: create benchmarks with sessions because cookies are propagates between requests.
  • Stats: get nice statistics about all the requests. Example: cookies.yml
  • Thresholds: compare the current benchmark performance against a stored one session and fail if a threshold is exceeded.
  • Tags: specify test plan items by tags.

Test it

Go to the example directory and you'll find a README how to test it in a safe environment.

Disclaimer: We really recommend not to run intensive benchmarks against production environments.

Command line interface

Full list of cli options, which is available under drill --help

drill 0.8.3
HTTP load testing application written in Rust inspired by Ansible syntax

USAGE:
    drill [FLAGS] [OPTIONS] --benchmark <benchmark>

FLAGS:
    -h, --help                      Prints help information
        --list-tags                 List all benchmark tags
        --list-tasks                List benchmark tasks (executes --tags/--skip-tags filter)
    -n, --nanosec                   Shows statistics in nanoseconds
        --no-check-certificate      Disables SSL certification check. (Not recommended)
    -q, --quiet                     Disables output
        --relaxed-interpolations    Do not panic if an interpolation is not present. (Not recommended)
    -s, --stats                     Shows request statistics
    -V, --version                   Prints version information
    -v, --verbose                   Toggle verbose output

OPTIONS:
    -b, --benchmark <benchmark>    Sets the benchmark file
    -c, --compare <compare>        Sets a compare file
    -r, --report <report>          Sets a report file
        --skip-tags <skip-tags>    Tags to exclude
        --tags <tags>              Tags to include
    -t, --threshold <threshold>    Sets a threshold value in ms amongst the compared file
    -o, --timeout <timeout>        Set timeout in seconds for all requests

Roadmap

  • Complete and improve the interpolation engine
  • Add writing to a file support

Donations

If you appreciate all the job done in this project, a small donation is always welcome:

"Buy Me A Coffee"

Contribute

This project started as a side project to learn Rust, so I'm sure that is full of mistakes and areas to be improve. If you think you can tweak the code to make it better, I'll really appreciate a pull request. ;)

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory