advanced·10 min read·Updated

API Performance Testing Strategy: Targets, Schedules and Load Agents (Part 3)

One good load test is not a plan. Set performance targets the team shares, protect production, schedule runs with notifications, split load across agents and gate your pipeline on the result.

This is lesson 9.13, part 3 of 3, of Shift-Left API in Depth, the product track of the learning center. In part 2, you read a performance report. Now you make testing repeatable and safe. Performance testing is a paid add-on on Professional, Custom and Enterprise, and the 15-day trial includes it. Without it, the Performance tab shows a locked preview with example figures. The demo calls the sandbox store API.

What does an API performance testing strategy need?

An API performance testing strategy needs more than one good test: targets the whole team agrees on, safe environments, runs that happen without you, and enough load.

Two terms differ. A threshold belongs to one scenario and judges one run. A performance target (SLO) belongs to the project and is judged from ordinary test runs over the last set number of runs. Load tests are judged against it too. It can cover the project or one endpoint, in one environment or all. Only load tests measure throughput.

How do you set performance targets?

  1. Open Project Settings, then Performance targets.
  2. If a requirement states a response-time limit and has no target, find it under Suggested from requirements and click Add as SLO. It keeps the link.
  3. Or click Add target. Choose the environment and endpoint, set limits for p95, p99, errors or minimum throughput, and choose how many recent runs to judge.
  4. Click Evaluate now. A target is met, at risk, breached or lacks enough data, and How says what it was judged on.

In a scenario's targets step, tick Use project SLOs. The report then shows them, along with linked requirements verified under load. In the traceability matrix, the Under load column shows met or missed.

How do you protect production from accidental load?

Load goes only to a project environment, each project is confirmed once, and every run checks each step first. Production is locked until an administrator allows load testing on it. Even then, you type the environment's name to start. A dry run never sends to production, and a production schedule asks for the name when saved. Only an administrator can switch a production environment back.

In Environment Settings you can add monitoring links that carry the run's time window. You can also set up reading target metrics during runs from Prometheus, Azure Monitor or Amazon CloudWatch. Credentials are references to your secret store.

How do you schedule runs without watching them?

In a scenario's review step, tick Run on a schedule. Choose hourly, daily, weekly or a custom cron expression. A custom expression is read in your time zone and shown as a sentence, with the next five starts. Custom schedules can't start runs less than fifteen minutes apart.

Tick Tell people when a run finishes and, if you like, only when it doesn't pass. Send email, or use Slack, Teams or another webhook. You can also turn a Test Run Pack into a load test with Create load scenario from this pack.

How do load agents add more load?

A load agent is a machine that sends a share of a test. Only an administrator can register, approve, replace or revoke agents, because each receives the credentials its share needs.

  • Register an agent: name it and set its most users. Its secret is shown once. Copy the environment variables and start the local runner as a load agent on that machine. Replace the secret if it leaks, or revoke the agent.
  • This computer: in the desktop app, offer your computer with no terminal or secret to copy. An administrator approves it, and it works only while the app is open.
  • Split a run: choose Split across load agents, optionally including this server. Each generator takes an equal share, and the Generator tab shows whether each kept up. If a chosen agent is offline, the run is refused until the agent is started.

How do results reach dashboards and CI?

Under Analytics, the DevOps and QA lead dashboards include widgets for performance targets, the load test trend and the latest verdicts. They don't appear on shared public dashboards. From CI, use an API key to start a scenario, check its status until it finishes, then fetch its JUnit file, with one test case per target plus the verdict. Let the pipeline fail when the run fails. The key needs permission to run tests and export reports.

Add-ons come in packages that set limits such as users per generator, run length, runs at once and load agents. If an add-on ends, scenarios, runs and reports stay readable, while new runs and schedules stop until it is renewed.

Try it yourself

Add one target and use it in a scenario. Schedule it with a cron expression. Then split one small run across this computer and the server.

Recap

  • Start API performance testing with targets, from your requirements where you can.
  • Mark production, and allow load on it only on purpose.
  • Run a smoke test before a load test, then schedule runs off-hours.
  • Split load before the generator gives out, and gate CI on the JUnit file.

Next, in lesson 9.14, you test the security of your endpoints. For the wider discipline, read API performance testing.

Hands-on lab

Try it: With a trial edition, add one performance target and use it in a scenario, schedule the scenario with a cron expression, then split one small run across this computer and the server and read its Generator tab.

Enter your email to open the lab steps. One unlock opens every lab in the learning center.

No spam. Protected by reCAPTCHA — Google Privacy & Terms.

Frequently asked questions

What belongs in an API performance testing strategy?+

Agreed targets, safe environments, runs that happen without a person and enough load from enough places. It also helps to run a smoke test before a load test and to let your pipeline fail when a performance run fails.

What is the difference between a threshold and service level objectives?+

In Shift-Left API, a threshold belongs to one scenario and judges one run. A performance target, or SLO, belongs to the project, is judged from your ordinary test runs over the last set number of runs, and load tests are judged against it too. Throughput is measured only by load tests.

Does distributed load testing need separate load agents?+

Only when one machine isn't enough or you need load from several places. An agent connects out to the server, so nothing needs to be opened on its firewall, but it must be able to reach that server. In the desktop app, you can also offer the computer you are using.

Read more on the blog