Skip to content

Commit 32c3d58

Browse files
committed
fmt
1 parent 9fdf0d0 commit 32c3d58

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

lib/llm/src/http/service/metrics.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,7 @@ impl Metrics {
291291
}
292292

293293
/// Create a new [`ResponseMetricCollector`] for collecting per-response metrics (i.e., TTFT, ITL)
294-
pub fn create_response_collector(
295-
self: Arc<Self>,
296-
model: &str,
297-
) -> ResponseMetricCollector {
294+
pub fn create_response_collector(self: Arc<Self>, model: &str) -> ResponseMetricCollector {
298295
ResponseMetricCollector::new(self, model.to_string().to_lowercase())
299296
}
300297
}

lib/llm/src/http/service/openai.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,10 @@ async fn completions(
152152
.get_completions_engine(model)
153153
.map_err(|_| ErrorResponse::model_not_found())?;
154154

155-
let mut inflight_guard = state.metrics_clone().create_inflight_guard(
156-
model,
157-
Endpoint::Completions,
158-
streaming,
159-
);
155+
let mut inflight_guard =
156+
state
157+
.metrics_clone()
158+
.create_inflight_guard(model, Endpoint::Completions, streaming);
160159

161160
let response_collector = state.metrics_clone().create_response_collector(model);
162161

@@ -275,11 +274,10 @@ async fn chat_completions(
275274
.map_err(|_| ErrorResponse::model_not_found())?;
276275

277276
// Create separate guards - no Arc/Mutex needed
278-
let mut inflight_guard = state.metrics_clone().create_inflight_guard(
279-
model,
280-
Endpoint::ChatCompletions,
281-
streaming,
282-
);
277+
let mut inflight_guard =
278+
state
279+
.metrics_clone()
280+
.create_inflight_guard(model, Endpoint::ChatCompletions, streaming);
283281

284282
let response_collector = state.metrics_clone().create_response_collector(model);
285283

@@ -410,7 +408,7 @@ async fn monitor_for_disconnects(
410408
Box<dyn Stream<Item = Result<axum::response::sse::Event, axum::Error>> + std::marker::Send>,
411409
>,
412410
context: Arc<dyn AsyncEngineContext>,
413-
mut inflight_guard: InflightGuard,
411+
mut inflight_guard: InflightGuard,
414412
) -> ReceiverStream<Result<Event, axum::Error>> {
415413
let (tx, rx) = tokio::sync::mpsc::channel(8);
416414

0 commit comments

Comments
 (0)