# request-prosperf

> A library for test responce time of a service

Latest version **1.0.0** (published 2021-08-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install request-prosperf
pnpm add request-prosperf
yarn add request-prosperf
bun add request-prosperf
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-08-08 |
| First published | 2021-08-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Smaug6739 |
| Maintainers | smaug-6739 |
| Keywords | request, time, timeout, test, tester |

## Links

- npm: https://www.npmjs.com/package/request-prosperf
- Repository: https://github.com/Smaug6739/request-prosperf
- Homepage: https://github.com/Smaug6739/request-prosperf#readme
- Issues: https://github.com/Smaug6739/request-prosperf/issues
- npm.io page: https://npm.io/package/request-prosperf

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-08-08

## README

# Request prosperf

This module provides a simple way to get statistics on an http service.  
You can follow the evolution of response times and improve the efficiency of your services.  
This module provides simple reports by calculating the average response time or with the detail of your service. You can choose to export the details of each request in a json file.

## Getting Started

### Prerequisites

Node.js 14.0.0 or newer is required.

### Instalation

Install the module with npm or yarn :

With npm :

```
npm install request-prosperf
```

With yarn :

```
yarn add request-prosperf
```

## Usage

Import the module from node_modules :

With CommonJS syntax :

```js
const { RequestTerter } = require("request-prosperf");
```

With module syntax :

```js
import {RequestTerter} = from 'request-prosperf';

```

Create a new instance of RequestTerter :

```js
const options = {
  requests: 200; // Number of requests to test
  maxRequestTimeout: 2000; // Maximum time in milliseconds
  output: 'result.json'; // Json file
  cooldown: 0; // Setup cooldown between requests (in ms)
  throwOnError: false; // Throw on error
  method: 'GET'; // HTTP method to use
  body: null; // The body of the request
}
const tester = new RequestTerter('http://localhost:8080/ping',{options});
```

## Methods of RequestTerter

---

### start()

Start the testing.

Return : Promise\<ResultResponse>

## Properties of ResultResponse

---

### time

Return the total time in milliseconds for test every request.

### medium

The medium time of request.

## Methods of ResultResponse

---

### toJSON()

View detail as a json.

Return : JSON

---

## Authors

- [Smaug6739](https://github.com/Smaug6739)

---
_Source: https://npm.io/package/request-prosperf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
