-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
This page provides instructions on how to use the iCanLoadJS Performance Testing Module for conducting performance tests on HTTP endpoints.
To perform a basic performance test using iCanLoadJS, follow these steps:
- Import the icanloadjs module into your Node.js script:
const icanloadjs = require('icanloadjs');- Define the parameters for your performance test, such as the URL, HTTP method, number of requests, number of virtual users, data payload (if applicable), and any thresholds:
const url = 'https://example.com/api';
const method = 'GET';
const numRequests = 100;
const numVirtualUsers = 5;
const data = { key: 'value' };
const thresholds = {
maxFailedChecks: 5,
// Add more thresholds as needed
};- Run the performance test using the runIcan function:
icanloadjs.runIcan(url, method, numRequests, numVirtualUsers, data, thresholds);- View the metrics and results in the console output. The module provides various metrics, including the total number of requests, minimum and maximum response times, average response time, and more.
You can customize your performance test by adjusting the parameters and thresholds based on your specific testing requirements. For example:
const url = 'https://example.com/api';
const method = 'POST';
const numRequests = 200;
const numVirtualUsers = 10;
const data = { key: 'value' };
const thresholds = {
maxFailedChecks: 10,
// Add more thresholds as needed
};
icanloadjs.runIcan(url, method, numRequests, numVirtualUsers, data, thresholds);Explore the Metrics section to understand the metrics provided by the module. Additionally, you may want to set Thresholds to validate the success of your performance test.
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!