cargo fmt: format all Rust source files
All checks were successful
CI — P1 Route (Rust) / test (push) Successful in 6m35s
All checks were successful
CI — P1 Route (Rust) / test (push) Successful in 6m35s
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user