Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zhaoyu6
sglang
Commits
7590f522
Unverified
Commit
7590f522
authored
Jul 09, 2025
by
Shuaiyi Zhang
Committed by
GitHub
Jul 09, 2025
Browse files
[router] Update metrics when request completes (#7899)
parent
f9df11ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
sgl-router/src/router.rs
sgl-router/src/router.rs
+3
-0
No files found.
sgl-router/src/router.rs
View file @
7590f522
...
@@ -842,6 +842,8 @@ impl Router {
...
@@ -842,6 +842,8 @@ impl Router {
if
let
Ok
(
mut
queue
)
=
running_queue
.lock
()
{
if
let
Ok
(
mut
queue
)
=
running_queue
.lock
()
{
if
let
Some
(
count
)
=
queue
.get_mut
(
worker_url
)
{
if
let
Some
(
count
)
=
queue
.get_mut
(
worker_url
)
{
*
count
=
count
.saturating_sub
(
1
);
*
count
=
count
.saturating_sub
(
1
);
gauge!
(
"sgl_router_running_requests"
,
"worker"
=>
worker_url
.to_string
())
.set
(
*
count
as
f64
);
}
}
}
}
}
}
...
@@ -874,6 +876,7 @@ impl Router {
...
@@ -874,6 +876,7 @@ impl Router {
let
mut
locked_queue
=
running_queue
.lock
()
.unwrap
();
let
mut
locked_queue
=
running_queue
.lock
()
.unwrap
();
let
count
=
locked_queue
.get_mut
(
&
worker_url
)
.unwrap
();
let
count
=
locked_queue
.get_mut
(
&
worker_url
)
.unwrap
();
*
count
=
count
.saturating_sub
(
1
);
*
count
=
count
.saturating_sub
(
1
);
gauge!
(
"sgl_router_running_requests"
,
"worker"
=>
worker_url
.to_string
())
.set
(
*
count
as
f64
);
debug!
(
"Streaming is done!!"
)
debug!
(
"Streaming is done!!"
)
}
}
}),
}),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment