Skip to content

Traffic View

The Traffic view lets you record live API traffic flowing through CloudMock, replay it at variable speeds, and compare replay runs. This is useful for regression testing, load testing, and reproducing production-like traffic patterns against your local environment.

The view is organized into four tabs:

TabPurpose
RecordCapture live traffic into named recordings
ReplayPlay back a recording at configurable speed
HistoryView past replay runs with metrics
CompareCompare two replay runs side by side

On the Record tab:

  1. Enter a recording name (e.g., “checkout-flow”, “peak-traffic-wednesday”).
  2. Select a duration: 30 seconds, 1 minute, 5 minutes, or 10 minutes.
  3. Click Start Recording.

While recording is active, a pulsing indicator shows the recording name and a Stop button to end early. CloudMock captures every API request that passes through the gateway during the recording window via POST /api/traffic/record.

Below the recording form, a list of saved recordings shows:

  • Name — The recording identifier.
  • Request count — How many requests were captured.
  • Duration — Recording length in seconds.
  • Replay button — Jump to the Replay tab with this recording selected.
  • Delete button — Remove the recording via DELETE /api/traffic/recordings/{id}.

On the Replay tab:

  1. Select a recording from the dropdown.
  2. Choose a speed multiplier: 1x (real-time), 2x, 5x, or 10x.
  3. Click Start Replay.

The replay sends each captured request back through CloudMock at the selected speed. A progress bar shows how many requests have been sent, and live stats update during the replay:

StatDescription
Sent / TotalNumber of requests replayed out of total
ErrorsCount of failed replay requests
P9999th percentile latency of replayed requests
StatusCurrent replay state (running, completed, cancelled, failed)

The replay is managed server-side. The view polls GET /api/traffic/replay/{id} every second to update progress.

The History tab shows a table of all past replay runs:

ColumnDescription
RecordingName of the recording that was replayed
SpeedReplay speed multiplier (1x, 2x, etc.)
SentRequests sent vs. total
ErrorsError count (highlighted in red if > 0)
P9999th percentile latency
StatusCompleted, cancelled, or failed

The Compare tab allows you to select two runs from the History tab and compare their latency distributions side by side. This is useful for comparing performance before and after a code change or configuration update.

MethodPathDescription
GET/api/traffic/recordingsList all saved recordings
POST/api/traffic/recordStart a new recording (body: {name, duration_sec})
POST/api/traffic/record/stopStop the current recording early
DELETE/api/traffic/recordings/{id}Delete a saved recording
POST/api/traffic/replayStart a replay (body: {recording_id, speed})
GET/api/traffic/replay/{id}Get replay run status and progress
GET/api/traffic/runsList all past replay runs