https://github.com/french-exception/node-function-load-perf-tester
A simple class wrapping around to let you easily load test a function and get its average
https://github.com/french-exception/node-function-load-perf-tester
Last synced: over 1 year ago
JSON representation
A simple class wrapping around to let you easily load test a function and get its average
- Host: GitHub
- URL: https://github.com/french-exception/node-function-load-perf-tester
- Owner: French-Exception
- Created: 2020-01-29T21:28:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T06:01:25.000Z (over 3 years ago)
- Last Synced: 2025-03-17T22:59:43.811Z (over 1 year ago)
- Language: TypeScript
- Size: 442 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
Simple wrapping execution of function n'th times around performance = and returns average.
Purpose here is to facilitate coding of functional tests with load-testing.
Bear in mind that most of CI tests CAN run under heavy-load.
# Installation
```bash
npm i --save @frenchex/function-load-perf-tester-lib
```
# Basic usage
```typescript
import {expect} from 'chai';
it('is performant construction', async function () {
const tester = new FunctionLoadTesterSpecs();
(await tester
.measureAverage(async () => {
// your code here
},
100, // execute 100 times to generate an average
expect // wrapping function for resulting average
))
.to.be.lte(1, `Construction must be lte`); //which let us fluently test return
});
```