03 August 2018

Getting the Most Out of your Load Impact 4.0 Free Trial

John Emmitt


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.

Getting Started

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:

Fig 1 Create New Test

Figure 1: Select from 3 different test creation options

Select Test URLs and go to this screen:

URL Test Screen in UI

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:

URL Test Results Screen

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

When running performance tests, it’s generally good to make them as realistic as possible. One way to do this is to capture activity in your browser and save it as a HAR file. A number of browsers, including Chrome, Firefox and Microsoft Edge, as well as many other tools, can generate HAR files. k6 has a built-in HAR converter that will read HAR files and convert them to k6 test scripts (JavaScript) that can then be executed.

Click on Create New Test and select Browser recording, as shown in the middle of Figure 1 above.

Browser Recording Screen in UI

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.

Take It to the Next Level- Create a JavaScript Test Script

One of the powerful features of Load Impact 4.0 is the ability to create test scripts directly in JavaScript. There’s an in-app editor (IDE) where you can create, edit, and run your test scripts right in the Load Impact SaaS platform. This means you don’t need to download and install k6 to create and run your initial tests (but you’ll want to do that later!)

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.

Sample JS Test Script

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.

Finally, this is a JavaScript environment, so you can express complex behaviors and actions as code. Make any edits you would like then click SAVE AND RUN to start your test. The Virtual Users will follow the ramping configuration specified.

View your results.

Now You’re Ready for the Big Leagues

To really get the full value out of Load Impact 4.0, download and install k6 on your local machine. The beauty of this is now you can run tests locally, behind your firewall using the command line. Create JavaScript test scripts locally too, using your favorite IDE. We provide lots of sample test scripts to help you get started. You can still stream your test data to the Load Impact cloud (Load Impact Insights) for storage, analysis and sharing with team members. Your local scripts run unchanged on the Load Impact cloud platform (e.g. when you want to take advantage of Cloud Execution to run larger tests).

Refer to installation page in the k6 docs for additional information on how to install k6 on your system.

Using k6 locally to trigger tests

Local Execution with local output

This 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 https://github.com/loadimpact/k6/samples/http_get.js

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 https://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 https://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.

Performance Alert

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:


Additional Resources

< Back to all posts