> OctoPerf load testing - OctoPet samples documentation page. The sample Virtual Users of OctoPerf test OctoPet, a public demo shop that can fail on purpose: one sample per engine, JMeter, K6 and Playwright.

Source: https://api.octoperf.com/doc/design/create-virtual-user/octopet-samples/

# OctoPet samples

[OctoPet](https://pet.octoperf.com) is the public demo shop of OctoPerf. Each engine comes with a sample Virtual User that buys a pet on it: you can validate it and run a test in minutes, before writing a script of your own.

OctoPet is healthy by default, and it can also **fail on purpose**: switch one variable, run the same test again, and the report shows how each failure looks. It is a safe way to learn how to read a report.

## Create a sample

There are three ways to get a sample:

- **The Sample Project**: the project created when you sign up already holds the OctoPet HTML sample.
- **The Create Virtual User page**: pick the **JMeter Project (JMX)**, **K6 Scripts** or **Playwright Project** card, choose no file, then click **Create Sample VU**. See [Create Virtual User](https://api.octoperf.com/doc/design/#create-virtual-user).
- **An AI assistant**: the `create_sample_virtual_user` tool of the [MCP server](https://api.octoperf.com/doc/mcp/) creates the sample of one engine in a project.

Each sample carries a description that sums up what it does. Creating a sample again adds a new Virtual User, and runs nothing.

## The three samples

| Sample | Engine | What it does |
|--------|--------|--------------|
| **OctoPet HTML** | JMeter | A buyer on the HTML pages of the shop: browses a random category and product, adds every variant to the bag, signs in, places the order and signs out. Its requests and responses are recorded, so you can compare a validation with the recording. |
| **OctoPet API** | [K6](https://api.octoperf.com/doc/design/create-virtual-user/import-k6-scripts/) | The same buyer on the JSON API of the shop. The script shows groups, CSV and random variables read with `row()` and `random()`, custom metrics, thresholds and `http.batch`. |
| **OctoPet SPA** | [Playwright](https://api.octoperf.com/doc/design/create-virtual-user/import-playwright-node-project/) | The same buyer in a real browser, on the single-page application of the shop, up to the confirmation of the order. Its [aggregators](https://api.octoperf.com/doc/design/edit-virtual-user/action-types/playwright-actions/playwright-spec-action/#aggregators) name the resources the pages load. |

Each iteration signs in with its own demo account.

### Correlate the OctoPet HTML sample

The OctoPet HTML sample is **not correlated on purpose**: every form of the shop carries a one-time token, and the recorded values are refused. Until it is correlated, its first [validation](https://api.octoperf.com/doc/design/edit-virtual-user/validation/) fails with `403` errors. This is the demonstration of correlation: the fix is ready in the project.

To correlate it:

1. Open the [correlation rules](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/auto-correlation/) of the project: the sample added `csrf`, `formToken` and `orderNumber`.
2. [Apply them](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/auto-correlation/#apply-correlation-rules) to the OctoPet HTML Virtual User.
3. Validate it again: the order is now placed.

The K6 and Playwright samples need no correlation.

## The shared variables

The samples read three [variables](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/variables/) of the project:

| Variable | Type | Content |
|----------|------|---------|
| `OCTOPET_HOST` | [Constant](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/variables/constant/) | The address of the shop, `https://pet.octoperf.com`. The K6 and Playwright samples read it; the JMeter sample sends its requests to the `pet.octoperf.com` [server](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/servers/) of the project. |
| `OCTOPET_MODE` | [Constant](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/variables/constant/) | How the shop behaves: `fixed`, the healthy shop, by default. See [Make the shop fail](#make-the-shop-fail). |
| `octopet_credentials` | [CSV](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/variables/csv/) | 1,000 demo accounts, in the columns `octopetLogin` and `octopetPassword`. |

A sample creates these variables only when the project lacks them: a variable you already changed is kept. The three samples of a project share them, so **changing `OCTOPET_MODE` switches every sample of the project**.

## Make the shop fail

`OCTOPET_MODE` picks the version of the shop the samples test. Edit its value, then run the same test again:

| Mode | What fails | Seen by |
|------|------------|---------|
| `fixed` | Nothing: the reference to compare with | Every sample |
| `broken` | Every failure below in turn, each one second in ten | Every sample |
| `slow-pool` | A connection pool too small, held while the payment provider answers | JMeter, K6 |
| `checkout-contention` | Checkouts queued on the stock of the same item | JMeter, K6 |
| `rate-limit` | A limit of requests per address far too strict | JMeter, K6 |
| `server-errors` | A product page that fails when its reviews do | JMeter, K6 |
| `slow-search` | A catalogue that gets slower as orders pile up | K6 |
| `slow-payment` | A payment provider called with no timeout | K6 |
| `heavy-pages` | Oversized photos and a banner that shifts the page | Playwright |
| `script-errors` | A product page that throws a JavaScript error | Playwright |
| `memory-leak` | Response times drifting up after about an hour at a constant load | Not in a short test |

The description of the variable, in the **Variables** menu of the project, lists the same modes.

## The OctoPet demo SLA profile

The JMeter and K6 samples come with the **OctoPet demo** [SLA profile](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/sla-profiles/) attached:

- a **warning** as soon as an error appears,
- a **critical** alarm at 1 % of errors or above 10 seconds of response time.

Each threshold fires on a single interval, since the failures of `broken` last one second at a time. The profile stays silent on `fixed`, and raises alarms on `broken`.

The Playwright sample comes with the **Core Web Vitals** profile instead, which judges the [Web Vitals](https://api.octoperf.com/doc/design/edit-virtual-user/action-types/playwright-actions/playwright-spec-action/#core-web-vitals) of its pages.

## Before running a test

OctoPet is shared by every OctoPerf user, so keep your test small:

- **20 to 50 users**, with pauses between the pages, are enough to see every failure.
- **Run on one load generator**, one Location of one user profile: the demo accounts are not split between load generators, and two of them ordering with the same account make a checkout fail even on `fixed`.
- **The shop caps the requests in flight.** When other tests fill it, even `fixed` answers `503` at once, with the message *Octopet is at its load cap*: the test measured the cap, not the shop. Run it again later.
- **The shop is reset every night**: the orders of the day disappear.

## Run the demo with an AI assistant

The `octoperf://skills/octopet-demo` playbook of the [MCP server](https://api.octoperf.com/doc/mcp/#public-http-downloads) walks an AI assistant through the whole demo: it creates a sample, builds a small scenario, switches `OCTOPET_MODE` to `broken`, runs the test, reads the alarms and the errors, names each failure, then switches back to `fixed`. It asks for your go before the run, which uses credits.
