perfgate-client
Rust client library for the perfgate baseline service REST API.
Part of the perfgate workspace.
Problem
CI pipelines and local tools need a reliable way to talk to the centralized baseline service -- uploading run receipts, fetching baselines for comparison, promoting good builds, and recording verdicts. This crate wraps the REST API in a type-safe, async client with retries and local-filesystem fallback.
Key Operations
| Method | Description |
|---|---|
upload_baseline |
Push a run receipt to the server |
get_latest_baseline |
Fetch the current baseline for a benchmark |
get_baseline_version |
Fetch a specific historical version |
list_baselines |
Query with filtering and pagination |
promote_baseline |
Promote a version to active baseline |
delete_baseline |
Remove a baseline version |
submit_verdict |
Record a pass/warn/fail verdict |
list_verdicts |
Query verdict history |
health_check / is_healthy |
Server liveness probe |
Auth
- API key --
config.with_api_key("pg_live_...")sendsBearer <key> - JWT token --
config.with_token("ey...")sendsToken <jwt>
Resilience
- Retries with exponential backoff on 429/5xx (configurable via
RetryConfig) - Fallback --
FallbackClientreads from local storage when the server is unreachable, so CI never hard-fails on a transient outage
Quick Start
use ;
async
License
Licensed under either Apache-2.0 or MIT.