Statistics
Two collection methods return aggregated statistics across your organization’s test runs and test results, for building dashboards or reports:
TestRuns.stats()— status distribution, result breakdown, timeline, top executorsTestResults.stats()— pass rates by metric, behavior, category, topic, and timeline
Test Run Statistics
Use TestRuns.stats() to get aggregated data across all test runs in your organization.
Available Modes
| Mode | Description |
|---|---|
ALL | Complete dataset with all sections |
SUMMARY | Overall summary and metadata only |
STATUS | Status distribution (Completed, Partial, Failed, etc.) |
RESULTS | Test result pass/fail/pending breakdown |
TEST_SETS | Most frequently run test sets |
EXECUTORS | Top test executors |
TIMELINE | Monthly trend data |
Usage
Test Result Statistics
Use TestResults.stats() to get pass/fail breakdowns across test results, grouped by different dimensions.
Available Modes
| Mode | Description |
|---|---|
ALL | Complete dataset with all sections |
SUMMARY | Overall pass rates and metadata only |
METRICS | Pass rates per evaluation metric |
BEHAVIOR | Pass rates per behavior |
CATEGORY | Pass rates per category |
TOPIC | Pass rates per topic |
OVERALL | Aggregate pass/fail rates |
TIMELINE | Monthly trend data |
TEST_RUNS | Per-run summary breakdown |
Usage
Filtering
Both methods accept filter parameters to narrow results by time range, test sets, users, and more.
| Parameter | Type | Description |
|---|---|---|
months | int | Months of historical data (default: 6) |
top | int | Max items in ranked lists |
start_date | str | ISO date, overrides months |
end_date | str | ISO date, overrides months |
test_set_ids | list | Filter by test set IDs |
test_run_ids | list | Filter by test run IDs |
user_ids | list | Filter by user IDs |
Pandas Integration
Both TestRunStats and TestResultStats provide a to_dataframe() method for converting results to pandas DataFrames. This is useful for charting and further analysis in notebooks.
pandas is an optional dependency. Install it with pip install pandas if you want to use to_dataframe().
Related — Test Runs & Results | SDK Metrics | Test Execution