cargo fmt: format all Rust source files
All checks were successful
CI — P1 Route (Rust) / test (push) Successful in 6m35s

This commit is contained in:
2026-03-01 17:53:28 +00:00
parent 00db59ff83
commit a8a8c53917
12 changed files with 305 additions and 167 deletions

View File

@@ -5,13 +5,13 @@
//! Run: cargo bench --bench proxy_latency
//! CI gate: P99 must be < 5ms
use criterion::{criterion_group, criterion_main, Criterion, BenchmarkId};
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use std::sync::Arc;
use tokio::sync::mpsc;
use dd0c_route::{
AppConfig, TelemetryEvent, RouterBrain,
proxy::{create_router, ProxyState},
AppConfig, RouterBrain, TelemetryEvent,
};
struct NoOpAuth;
@@ -51,10 +51,13 @@ fn bench_proxy_overhead(c: &mut Criterion) {
let (tx, _rx) = mpsc::channel::<TelemetryEvent>(10000);
let mut providers = std::collections::HashMap::new();
providers.insert("openai".to_string(), dd0c_route::config::ProviderConfig {
api_key: "bench-key".to_string(),
base_url: mock_url.clone(),
});
providers.insert(
"openai".to_string(),
dd0c_route::config::ProviderConfig {
api_key: "bench-key".to_string(),
base_url: mock_url.clone(),
},
);
let config = Arc::new(AppConfig {
proxy_port: 0,
@@ -90,7 +93,8 @@ fn bench_proxy_overhead(c: &mut Criterion) {
let body = serde_json::json!({
"model": "gpt-4o",
"messages": messages,
}).to_string();
})
.to_string();
group.bench_with_input(
BenchmarkId::new("chat_completions", format!("{}_msgs", msg_count)),