mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
add backlog health
This commit is contained in:
parent
3b04839c9e
commit
732dd57bd3
2 changed files with 12 additions and 2 deletions
|
|
@ -37,8 +37,6 @@ class BacklogHealth:
|
|||
queue_regex = re.compile(r"(?:^|\s)(\d+)/(\d+)/(\d+)(?:\s|$)")
|
||||
|
||||
for line in output.splitlines():
|
||||
if "LISTEN" not in line:
|
||||
continue
|
||||
if not port_regex.search(line):
|
||||
continue
|
||||
queue_match = queue_regex.search(line)
|
||||
|
|
|
|||
|
|
@ -502,6 +502,18 @@ tcp4 2/0/128 *.4000 *.* LISTEN
|
|||
assert result["listen_queue_max"] == 128
|
||||
|
||||
|
||||
def test_parse_macos_netstat_listen_queue_two_column_format():
|
||||
sample_output = """Current listen queue sizes (qlen/incqlen/maxqlen)
|
||||
Listen Local Address
|
||||
3/0/128 *.4011
|
||||
"""
|
||||
result = BacklogHealth.parse_macos_netstat_listen_queue(
|
||||
output=sample_output, port=4011
|
||||
)
|
||||
assert result["listen_queue_current"] == 3
|
||||
assert result["listen_queue_max"] == 128
|
||||
|
||||
|
||||
def test_get_cached_listen_queue_stats_uses_cache():
|
||||
mock_stats = {
|
||||
"status": "healthy",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue