Skip to content

Latest commit

 

History

History
66 lines (39 loc) · 1.56 KB

File metadata and controls

66 lines (39 loc) · 1.56 KB

Run Your First Test

Let's walk through recording and replaying your first trace:

Step 1: Set sampling rate to 1.0

Set the sampling_rate in .tusk/config.yaml to 1.0 to ensure that all requests are recorded.

Step 2: Start server in record mode

Run your server in record mode using the TUSK_DRIFT_MODE environment variable:

TUSK_DRIFT_MODE=RECORD python app.py

Note: See the Environment Variables guide for more details about TUSK_DRIFT_MODE and other environment variables.

You should see logs indicating Tusk Drift is active:

[TuskDrift] SDK initialized in RECORD mode
[TuskDrift] App marked as ready

Step 3: Generate Traffic

Make a request to a simple endpoint that includes some database and/or network calls:

curl http://localhost:8000/api/test/weather

Step 4: Stop Recording

Wait for a few seconds and then stop your server with Ctrl+C. This will give time for traces to be exported.

Step 5: List Recorded Traces

In your project directory, list the recorded traces:

tusk list

You should see an output similar to:

List output

Press ESC to exit the list view.

Need to install the Tusk CLI? See CLI installation guide.

Step 6: Replay the Trace

Replay the recorded test:

tusk run

You should see an output similar to:

Run output

Success! You've recorded and replayed your first trace.