If you have already signed up for a free trial of Load Impact 4.0 - thanks! If not, you can sign up here. We’d like to make it easier for you to achieve your product evaluation goals. This document provides some guidance to help you get the most out of your free trial and determine if Load Impact 4.0 meets your website, SaaS app, API, etc. performance testing needs.
Load Impact 4.0 is built on the k6 open source load testing tool that is freely available on GitHub. The other components of 4.0 are Load Impact Insights, for data storage and results analysis, and Cloud Execution, for running large test scenarios.
The simplest way to run your first load test is to run a URL test from the Load Impact User Interface.
When you click on Create New Test you’ll see this screen:
Figure 1: Select from 3 different test creation options
Select Test URLs and go to this screen:
Figure 2: The Test URLs input screen
Input the target URL. Upon running this test, the URL analyzer will visit the URL entered and create a script with all of the requests that are discovered for that target. This script includes all requests made, including external requests, just like if you were to visit the page.
It’s advised that you use the option to filter domains. This allows you to specify which domains you want to be included when generating the script. Generally speaking, you should not test third party resources. For example, trackers, analytic tools, advertising pixels, etc. Depending on your need, you may or may not want to include any Content Delivery Network (CDN) resources. For example, if you are testing test.loadimpact.com, you would use loadimpact.com as the domain filter.
Enter your URLs and test parameters then click the SAVE AND RUN button to start your test.
Next, take a look at your test results.
Here’s a screenshot showing the results for a simple URL test using test.loadimpact.com as the target:
Figure 3: Test Results in Load Impact Insights
The performance status section provides a high level overview of the performance of your test. You should consider the following:
- This test ramps to 50 Virtual Users over 2 minutes.
- If Thresholds were configured, you’d see the number of ‘passed Thresholds / Total Thresholds’
- Failed Thresholds return non-zero exit codes
- If Checks were configured, you’d see the number of passing ‘Checks / Total Checks’
- Checks will not fail a test, nor can they halt execution
- Checks are often used with a Threshold and Custom Metrics
- e.g. "check_failure_rate": ["rate<0.3"]
- The number of URLs with a ‘status code <400 / Total URL requests’
Some “ideal” performance result guidelines:
- Flat response times with rising Virtual Users
- Increasing throughput/request rate with rising Virtual Users
- Low number of errors/error rate not increasing with rising Virtual Users
Additional resources can be found in the Advanced Results Analysis section later in this guide.
Creating a Test from Browser Activity
Click on Create New Test and select Browser recording, as shown in the middle of Figure 1 above.
Figure 4: The Browser Recording input screen
The HAR file upload allows you to take a recorded browser session, where you emulated real user behavior, and convert that into a k6 script. The requests made in this session will be identical to the ones you made - so if you logged into a system, that will also be attempted. If your system uses any tokens to prevent CSRF attacks, it’s likely that you will see some 400 level responses (since the token has since expired).
Similar to the URL analyzer, you can also filter domains. We advise you to take the same care as mentioned above to limit the test to domains you are able to and want to test.
Simply upload your HAR file, set your test parameters and then click SAVE AND RUN.
Check your test results, as before.
Click on Create New Test and select Scripting as shown on the right side of Figure 1 above. You will see that the in-app script editor is pre-populated with a sample test script. You can edit this script to meet your needs.
Figure 5: Sample JS test script in the in-app editor
Take note of the script here; it defines your test configuration as well as the requests made. It is exactly what our platform reads and executes for your test.
Within the options section, you can define things such as ramping patterns or load zone distribution.
The default function serves as the main entry point for Virtual Users. That is, Virtual Users will iterate over this function until they ramp down or the test ends. You can change the GET request to your domain if you would like.
View your results.
Now You’re Ready for the Big Leagues
Download and Install k6:
Install the latest k6 package:
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
$ echo "deb https://dl.bintray.com/loadimpact/deb stable main" | sudo tee -a /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install k6
Install the latest k6 package:
$ wget https://bintray.com/loadimpact/rpm/rpm -O bintray-loadimpact-rpm.repo
$ sudo mv bintray-loadimpact-rpm.repo /etc/yum.repos.d/
$ sudo yum install k6
- Run the installer
Install k6 using Homebrew:
$ brew tap loadimpact/k6
$ brew install k6
Refer to installation options in the k6 docs for additional information.
Using k6 locally to trigger tests
Local Execution with local outputThis mode is useful for test validations and "smoke" tests. Load is generated from your local machine with output to stdout.
Run your first local k6 test with local output:
$ k6 run -u 1 -d 10s github.com/loadimpact/k6/samples
Local Execution with cloud streaming output
This mode is useful for testing behind the firewall. Cloud output enables you to analyze your results within Load Impact’s cloud platform. In stdout, you are given a link to the test results to watch in real-time.
$ k6 login cloud
$ k6 run -u 25 -d 5m github.com/loadimpact/k6/samples/http_get.js -o cloud
Cloud Execution triggered from local command line
This mode allows you to scale to a large number of Virtual Users on demand, utilizing Load Impact’s cloud infrastructure. Your script and its dependencies (if applicable) are uploaded to the Load Impact cloud service and then executed. In stdout, you are given a link to the test results to watch in real-time.
Run your first Cloud Execution test from the command line:
[if you did not complete the previous “streaming” step, you will need to `k6 login cloud`]
$ k6 cloud -u 25 -d 5m github.com/loadimpact/k6/samples/http_get.js
Advanced Results Analysis
The goal with Load Impact Insights is to make it easier for you to interpret your test results and resolve performance issues faster. One way it does this is by providing Performance Alerts. As your test runs, we apply performance algorithms to the results data set. Any potential performance problems that are detected are shown as a Performance Alert-- see, for example, the Test Health alert in the figure below.
Figure 6: Performance Alert - Test Health
Check out the following resources for more information on results analysis:
Next Steps -- Automating Testing (After Your Free Trial Perhaps)
Integrate Load Impact 4.0 into your Continuous Integration pipeline.
As a best practice, building test automation into your development cycle provides a multitude of benefits including:
- Deploying higher quality code faster
- Improving efficiencies
- Detecting performance issues before they become problems in production
Load Impact 4.0 and k6 are designed to fit nicely into automation pipelines or custom processes you've already created. The most popular CI tools, such as Circle CI, GitLab, Jenkins, Team City, etc., support making command line calls. This allows k6 to fit nicely into these workflows and build processes. This lets you run tests as part of the build process, and halt those builds, should a failing result be returned.
The test frequency varies from organization to organization. Our best practice recommendation is to run performance tests with your nightly builds.
If You Need Help
Don’t hesitate to contact our Support and Customer Success teams: