Skip to content

Metrics

Kuda Hitam edited this page Nov 19, 2023 · 1 revision

Metrics

The iCanLoadJS Performance Testing Module provides various metrics to assess the performance of your API during a performance test. These metrics offer insights into response times, request counts, and the success or failure of checks.

Available Metrics

  • 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.

Understanding Metrics

  • counter and totalRequests: These metrics provide an overview of the total number of requests made during the performance test.
  • minValue and maxValue: These represent the minimum and maximum response times recorded during the test.
  • averageValue: This metric indicates the average response time, providing insight into the overall performance.
  • modeValue: The mode represents the most frequently occurring response time.
  • percentileValue: This metric shows the response time at the 50th percentile, providing a median value.
  • socketWaitTime: Indicates the total time spent waiting for a socket to be allocated, which can be crucial for understanding potential bottlenecks.
  • checksPassed and checksFailed: These metrics count the number of successful and failed checks, allowing you to assess the success rate of your API responses.

Example

const metrics = new icanloadjs(thresholds);

// ... Perform performance tests ...

const calculatedMetrics = metrics.calculateMetrics();

console.log('Metrics:');
console.log(calculatedMetrics);

Next Steps

Explore the Thresholds section to learn how to set thresholds and validate the success of your performance test.

Clone this wiki locally