Git Product home page Git Product logo

clobbr's Introduction

clobbr grid logo

clobbr typeface logo

Clobbr - test your api's response times

Test your api endpoints to see how well they perform under multiple requests (clobber your apis!), in sequence or parallel.

@clobbr/cli version @clobbr/api version Tests

Clobbr api endpoint performance and speed test Application demo Clobbr api endpoint performance and speed test demo

Quick start

Application

Download on the Mac App Store or the Microsoft Store and start testing your api endpoints.

Command Line (cli)

npx @clobbr/cli run --url "https://api.github.com/zen"

Run npx @clobbr/cli to see all options or head over to @clobbr/cli docs.

Binaries are also available for your favorite OS here ⬇️ 💿.

CI

The cli can be used in a CI context too. See examples with popular CIs here ↗️

CircleCI integration config Travis CI integration config AppVeyor CI integration config

What the cli can do

This package can stress-test your API endpoints in various ways so you can get a better idea on how your app would work under a (closer to) real world scenario.

Configure requests, set iterations and analyze response times of your API endpoints in a fashionable ascii chart or jaw-dropping table.

On top of that, get stats on responses such as mean, standard deviation, 5th/95th/99th percentiles and more.

With all that, output to various file formats such as csv, json, yaml and more. Use in your CI of choice or just run it locally.

Usage examples for the cli

Kitchen sink example

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --method POST \
  --iterations 50 \
  --parallel \
  --checks mean=200 median=200 stdDev=50 q5=150 q50=200 q95=250 q99=300 pctOfSuccess=95 \
  --headersPath "headers.json" \
  --dataPath "data.json" \
  --outputFile \
  --outputFormat yaml \
  --table "compact"

This is an advanced run configuration example. Typically, less config is needed. Read on for more.

Define iterations

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --iterations 30

clobbr send api requests in parallel

Send requests in parallel

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --iterations 30 \
  --parallel

clobbr send api requests in parallel

Display a summary table

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --iterations 30 \
  --table "full"

clobbr show detailed api response summary table

Display a minimal summary table

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --iterations 30 \
  --table "compact"

clobbr show minimal api response summary table

Customize Request Method

GET is used as the default request method, but you can pass an optional request method, such as POST, PUT, PATCH, DELETE etc.

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --method OPTIONS

Send Headers

Arbitrary request headers are accepted as a JSON file.

Tip 💡

Passing { Cookie: "val" } adds a cookie to the request.

# headers.json
{
  "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.Et9HFtf9R3",
  "User-Agent": "Mozilla/5.0"
}
npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --iterations 20 \
  --headersPath "headers.json"

Send Data

Arbitrary request data is accepted as a JSON file.

# data.json
{
  "id": "17b",
  "user": {
    "firstName": "Jane",
    "lastName": "Doe"
  },
  "visits": 50
}
npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --iterations 20 \
  --method "POST" \
  --dataPath "data.json"

Analyze failed request iterations

By default, details on failed iterations are neatly displayed via the table option.

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --iterations 20 \
  --method "POST" \
  --headersPath "headers.json" \
  --dataPath "data.json" \
  --table "compact"

clobbr show minimal api response summary table

Get results in different file formats

Results will be shown in a human-readable format by default, but you can also get results in JSON, YAML and CSV format.

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --outputFormat json                \
  --outputFile

Run checks against results

Set target values for percentage of success (pctOfSuccess), mean (ms), median (ms), standardDeviation (stdDev in ms) and supported quantiles in ms (q5, q50, q95, q99).

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --checks mean=200 median=200 stdDev=50 q5=150 q50=200 q95=250 q99=300 pctOfSuccess=95

Run checks against results

Only include checks that you want to run. If you don't specify a check, it will not be run.

npx @clobbr/cli run \
  --url "https://api.github.com/zen" \
  --checks pctOfSuccess=90

Apihustle Logo

This tool is part of the Apihustle suite - a collection of tools to test, improve and get to know your API inside and out.
apihustle.com

Clobbr Logo Clobbr Debug multiple cron expressions on a calendar. clobbr.app
Crontap Logo Crontap Schedule API calls using cron syntax. crontap.com
CronTool Logo CronTool Debug multiple cron expressions on a calendar. tool.crontap.com

Clobbr icon

clobbr's People

Contributors

danmindru avatar dependabot[bot] avatar esau-morais avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.