@negev/cli
Run loadtests against your GraphQL backend
Last updated 3 months ago by marhaupe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @negev/cli 
SYNC missed versions from official npm registry.

@negev/cli

npm version Build Status

Benchmark your GraphQL servers with ease.

Installation

npm install -g @negev/cli

Demo

Why

Common loadtesting tools expect you to read documentation, write configuration files or hack together multline bash scripts. negev doesn't. Just run the negev command and answer some questions. (Don't worry, you still can write bash scripts - scroll down further for an example).

Additionally, most of them weren't written with GraphQL in mind, while this one exclusively serves the purpose of loadtesting GraphQL servers, for example:

  • Proper error detection: GraphQL queries that run into errors will commonly still have a 200 response, with the distinction that their body contains the errors field. Since most tools written for plain REST servers simply look at the HTTP statuscode of each response, they wouldn't even detect that something went wrong.
  • Schema validation: If you're querying something that isn't in your schema, negev won't even start loadtesting, saving you valuable time.

Usage

$ negev --help

Benchmark your GraphQL servers with ease.

USAGE
  $ negev

OPTIONS
  -H, --headers=headers                    request header. can be set multiple times. example: -H="Content-Type: application/json"
  -c, --concurrencyLimit=concurrencyLimit  the limit of concurrent requests
  -d, --duration=duration                  the total duration of the loadtest
  -e, --endpoint=endpoint                  the endpoint to test
  -h, --help                               show CLI help
  -n, --numberRequests=numberRequests      the number of requests to send
  -q, --query=query                        the query to use
  -r, --rateLimit=rateLimit                the limit of requests per second
  -v, --version                            show CLI version

EXAMPLES
  $ negev    # Will run the command in prompt-mode
  $ negev -e="http://localhost:4000" -q="{ books { author } }"   # Will immediately start a loadtest with the given configuration

Output

Summary:
 Total requests:      1000
 Loadtest duration:   823 ms
 Slowest:             57 ms
 Fastest:             21 ms
 Average:             40.02 ms
 Requests/sec:        1215.07

Histogram:
  21 ms: 1
  25 ms: 4
  29 ms: 23
  33 ms: 153
  37 ms: 242
  41 ms: 246
  45 ms: 202
  49 ms: 95
  53 ms: 26
  57 ms: 8
  61 ms: 0

Latency Distribution:
  10% in 28 ms
  25% in 36 ms
  50% in 31 ms
  75% in 43 ms
  90% in 48 ms
  95% in 50 ms
  99% in 54 ms

Error distribution:
 Successes   1000
 Errors      0

Current Tags

  • 0.0.1-alpha.5                                ...           latest (2 months ago)

6 Versions

  • 0.0.1-alpha.5                                ...           2 months ago
  • 0.0.1-alpha.4                                ...           3 months ago
  • 0.0.1-alpha.3                                ...           3 months ago
  • 0.0.1-alpha.2                                ...           3 months ago
  • 0.0.1-alpha.1                                ...           3 months ago
  • 0.0.1-alpha.0                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |