AIPerf API

Real-time benchmark monitoring via HTTP and WebSocket

GET /dashboard

Live dashboard with real-time progress and metrics via WebSocket.

HTTP Endpoints

GET /docs

Interactive API documentation with all available endpoints.

WebSocket Endpoint

WS /ws

Real-time ZMQ message stream with dynamic subscriptions.

Usage Examples

Prometheus Scraping

curl http://localhost:9090/metrics

JSON Metrics

curl http://localhost:9090/api/metrics | jq

WebSocket Client

const ws = new WebSocket("ws://localhost:9090/ws");

ws.onopen = () => ws.send(JSON.stringify({
    type: "subscribe",
    message_types: [
        "realtime_metrics", "realtime_telemetry_metrics",
        "credit_phase_progress", "credit_phase_start",
        "credit_phase_sending_complete", "credit_phase_complete",
        "processing_stats", "all_records_received",
        "worker_health", "worker_status_summary",
    ]
}));

ws.onmessage = (event) => {
    const msg = JSON.parse(event.data);
    console.log(msg.message_type, msg);
};
import asyncio
import websockets
import json

async def stream_metrics():
    async with websockets.connect("ws://localhost:9090/ws") as ws:
        await ws.send(json.dumps({
            "type": "subscribe",
            "message_types": [
                "realtime_metrics", "realtime_telemetry_metrics",
                "credit_phase_progress", "credit_phase_start",
                "credit_phase_sending_complete", "credit_phase_complete",
                "processing_stats", "all_records_received",
                "worker_health", "worker_status_summary",
            ],
        }))
        async for message in ws:
            print(json.loads(message))

asyncio.run(stream_metrics())