@negev/core
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.2 • Public • Published

@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,
});

Readme

Keywords

none

Package Sidebar

Install

npm i @negev/core

Weekly Downloads

0

Version

0.0.1-alpha.2

License

MIT

Unpacked Size

239 kB

Total Files

21

Last publish

Collaborators

  • marhaupe