Metrics¶
rampa automatically collects metrics for every iteration and HTTP request. You can also emit custom metrics from your scenario code.
Built-in metrics¶
Execution metrics¶
Metric |
Type |
Description |
|---|---|---|
|
Counter |
Completed iterations |
|
Trend |
Time per iteration (ms) |
|
Counter |
Failed iterations |
|
Counter |
Skipped iterations (arrival-rate) |
|
Gauge |
Active virtual users |
|
Gauge |
Peak virtual users |
HTTP metrics¶
Metric |
Type |
Description |
|---|---|---|
|
Counter |
Completed HTTP requests |
|
Trend |
Total request time (ms) |
|
Rate |
Failure ratio |
|
Counter |
Bytes sent |
|
Counter |
Bytes received |
HTTP phase timing¶
Metric |
Type |
Description |
|---|---|---|
|
Trend |
DNS + connection queue (ms) |
|
Trend |
TCP connection (ms) |
|
Trend |
Request send (ms) |
|
Trend |
Time to first byte (ms) |
|
Trend |
Response receive (ms) |
Check metrics¶
Metric |
Type |
Description |
|---|---|---|
|
Rate |
Check pass ratio |
Metric types¶
Type |
Tracks |
Aggregations |
|---|---|---|
Counter |
Cumulative total |
count, rate |
Gauge |
Current value |
value, min, max |
Rate |
Success ratio |
rate, passes, fails |
Trend |
Distribution |
count, avg, min, max, med, p(90), p(95), p(99) |
Custom metrics¶
Emit custom metrics from your scenario:
@rampa.scenario(executor="constant-vus", vus=5, duration="30s")
async def default(worker: rampa.Worker) -> None:
resp = await worker.http.get("https://api.example.com/items")
items = resp.json()
worker.counter("api_calls")
worker.gauge("items_returned", float(len(items)))
worker.trend("processing_time", 42.5)
Custom metrics appear in the console summary and JSON output alongside built-in metrics.