-
Notifications
You must be signed in to change notification settings - Fork 0
Home
iCanLoadJS Performance Testing Module
The iCanLoadJS Performance Testing Module is a Node.js module designed for conducting performance tests on HTTP endpoints. It provides a flexible framework for running multiple virtual users, tracking various metrics, and validating against predefined thresholds.
To install the iCanLoadJS Performance Testing Module, run the following command:
npm install icanloadjsconst icanloadjs = require('icanloadjs');
// Define your testing parameters
const url = 'https://example.com/api';
const method = 'GET';
const numRequests = 100;
const numVirtualUsers = 5;
const data = { key: 'value' };
const thresholds = {
maxFailedChecks: 5,
};
// Run the performance test
icanloadjs.runIcan(url, method, numRequests, numVirtualUsers, data, thresholds);const icanloadjs = require('icanloadjs');
const url = 'https://example.com/api';
const numRequests = 100;
const numVirtualUsers = 5;
icanloadjs.runIcan(url, 'GET', numRequests, numVirtualUsers);
const icanloadjs = require('icanloadjs');
const url = 'https://example.com/api';
const numRequests = 200;
const numVirtualUsers = 10;
const data = { key: 'value' };
const thresholds = {
maxFailedChecks: 10,
// Add more thresholds as needed
};
icanloadjs.runIcan(url, 'POST', numRequests, numVirtualUsers, data, thresholds);The module provides various metrics to assess the performance of your API:
- counter: Total number of requests made.
- totalRequests: Total number of requests made by all virtual users.
- minValue: Minimum response time recorded.
- maxValue: Maximum response time recorded.
- nonZeroCount: Number of non-zero response times.
- sum: Sum of all response times.
- averageValue: Average response time.
- modeValue: Mode of response times.
- percentileValue: Response time at the 50th percentile.
- socketWaitTime: Total time spent waiting for a socket to be allocated.
- checksPassed: Number of successful checks.
- checksFailed: Number of failed checks.
Define thresholds to validate the success of the performance test:
- maxFailedChecks: Maximum allowed failed checks. If exceeded, the test will be considered failed.
iCanLoadJS Performance Testing Module
This documentation is part of the iCanLoadJS Performance Testing Module for conducting performance tests on HTTP endpoints. For more information, check out the official repository on GitHub.
Contributing
If you'd like to contribute to the development of iCanLoadJS, please see our Contribution Guidelines.
License
This project is licensed under the MIT License.
Maintainer
- Faris Kurnia (ModalQA)
Feel free to raise issues, submit pull requests, and contribute to the improvement of iCanLoadJS. We welcome your feedback and contributions!