To find regressions, you can compare data from multiple test runs. k6 Cloud provides three graphical ways to compare tests over time:
- Between a recent run and a baseline
- Between two selected runs
- Across all runs for a certain script
Test comparison works only on runs from the same test script
You can't compare two different test scripts.
Comparing results against a known baseline is a core part of the general methodology for automated performance testing. Baseline tests are important for comparing against a control and finding differences.
Baseline tests should produce enough load to contain meaningful data and ideal results. In other words, a heavy stress test isn't a good baseline. Think much smaller.
To set your baseline, follow these steps:
- Open the results for the test run you wish to be your baseline.
- Select the three dots in the top right corner, then set as Baseline.
Baseline tests are exempt from data-retention policies.
To compare two test runs, follow these steps:
- Open up a test run.
- In the top right, select Compare result.
- Select the test run you want to compare the test to.
When you compare tests, the layout of the performance-overview section changes to comparison mode. Comparison mode has controls for changing base and target tests, and the overview chart now renders time series for the two compared test runs.
Solid lines represent the base run, and dashed lines represent the comparison. To make a certain time series more visible, select the appropriate element in the interactive legend.
If a test has multiple scenarios, k6 presents a performance overview for each one. If the test script uses multiple protocols, k6 categorizes the overview data by protocol.
To compare thresholds, select the Thresholds tab. You can add additional data to the table for the base and target test runs.
You can compare the following threshold data from the current and previous runs:
- The value of the threshold
- pass/fail statuses
- Previous and current test-run values for each threshold and its pass/fail status.
To display a separate threshold chart for each test run, select a threshold.
To compare checks, use the Checks tab. Here, k6 provides extra data on the table for the base and target test runs.
You can compare the following metrics from the current and previous runs:
- Success Rate
- Success Count
- Fail Count
To display separate check charts for each test run, select a check.
To compare HTTP requests, use the HTTP tab. Here, k6 provides extra data on the table for the base and target test runs.
You can compare the following data from the current and previous runs:
- Metrics such as:
- request count
- p95 response time
- Other data for individual HTTP requests.
To show separate charts, select the rows for each test run that you want to compare. You can add extra charts, such as timing breakdowns for each HTTP request.
To compare multiple tests across time, use the performance-trending chart. The chart shows test times and uses colors to signal the status of a specific test.
To view the performance-trending graph, use the Project page, or select the name of any given test. In both cases, k6 plots the p95 response time metric for all HTTP requests from the test run.
The top-level page for a project shows all project tests and run statuses. It provides a high-level view of how performance trends over time.
In this example, the script api.js is running its test, Demo with Cloud Execution. Though its previous runs had quite a few failures, this run is passing and trending down—a good sign.
For a performance-trending graph of a specific test run, select the test. This graph shows more data points over time.
For more information, hover over any bar in the graph. This test has stable response times between test runs but fails its thresholds.