@negev/core
loadtest your graphql servers
Last updated 3 months ago by marhaupe .
MIT · Original npm · Tarball · package.json
$ cnpm install @negev/core 
SYNC missed versions from official npm registry.

@negev/core

npm version Build Status codecov

Benchmark your GraphQL servers with ease.

Installation

npm install @negev/core

Usage

Config

Depending on your configuration, you can execute a loadtest that runs for a certain amount of time (by setting duration) or one that sends a specified amount of requests (by setting numberRequests). Note that if both fields are present, numberRequests will be ignored.

Parameter Default Description
endpoint Required The endpoint to test
query Required The query / mutation to send
headers None The headers attached to each request
rateLimit None The limit for how many requests are sent per second
concurrencyLimit 50 The limit for how many concurrent requests can be sent
duration 15 The duration (in seconds) of the loadtest.
numberRequests 500 The count of how many total requests are sent.

Example - numberRequests

import { executeLoadtest } from '@negev/core';

const loadtestResult = await executeLoadtest({
  endpoint: 'https://example.com/query',
  query: '{ books { author } }',
  headers: {
    'Content-type': 'application/json',
  },
  numberOfRequests: 1000,
});

Example - duration

import { executeLoadtest } from '@negev/core';

const loadtestResult = await executeLoadtest({
  endpoint: 'https://example.com/query',
  query: '{ books { author } }',
  headers: {
    'Content-type': 'application/json',
  },
  duration: 15,
});

Current Tags

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

2 Versions

  • 0.0.1-alpha.2                                ...           3 months ago
  • 0.0.1-alpha.1                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (13)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |