[model-gateway] optimize metric labels to avoid unnecessary allocations (#15095)

This commit is contained in:
Simo Lin
2025-12-13 21:10:45 -08:00
committed by GitHub
parent 0fa044ad63
commit 74ea45cc4b
4 changed files with 43 additions and 43 deletions
@@ -971,7 +971,7 @@ impl PDRouter {
&self,
client: &Client,
url: &str,
route: &str,
route: &'static str,
json_request: &Value,
headers: Option<&HeaderMap>,
connection_close: bool,
+3 -3
View File
@@ -159,7 +159,7 @@ impl Router {
&self,
headers: Option<&HeaderMap>,
typed_req: &T,
route: &str,
route: &'static str,
model_id: Option<&str>,
) -> Response {
let start = Instant::now();
@@ -210,7 +210,7 @@ impl Router {
&self,
headers: Option<&HeaderMap>,
typed_req: &T,
route: &str,
route: &'static str,
model_id: Option<&str>,
is_stream: bool,
text: &str,
@@ -418,7 +418,7 @@ impl Router {
&self,
headers: Option<&HeaderMap>,
typed_req: &T,
route: &str,
route: &'static str,
worker_url: &str,
is_stream: bool,
load_incremented: bool, // Whether load was incremented for this request