Skip to content

Commit

Permalink
Fix buckets for time based historgram metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
binarycrayon committed Nov 8, 2024
1 parent 3fa9361 commit 588f2c3
Showing 1 changed file with 51 additions and 3 deletions.
54 changes: 51 additions & 3 deletions python/sglang/srt/metrics/metrics_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,67 @@ def __init__(self, labelnames: List[str], max_model_len):
name="sglang:e2e_request_latency_seconds",
documentation="Histogram of End-to-end request latency in seconds",
labelnames=labelnames,
buckets=build_1_2_5_buckets(max_model_len),
buckets=[
0.3,
0.5,
0.8,
1.0,
1.5,
2.0,
2.5,
5.0,
10.0,
15.0,
20.0,
30.0,
40.0,
50.0,
60.0,
],
)
self.histogram_time_waiting_requests = Histogram(
name="sglang:waiting_request_latency_seconds",
documentation="Histogram of request waiting time in seconds",
labelnames=labelnames,
buckets=build_1_2_5_buckets(max_model_len),
buckets=[
0.3,
0.5,
0.8,
1.0,
1.5,
2.0,
2.5,
5.0,
10.0,
15.0,
20.0,
30.0,
40.0,
50.0,
60.0,
],
)
self.histogram_time_decode_requests = Histogram(
name="sglang:decode_request_latency_seconds",
documentation="Histogram of request decoding time in seconds",
labelnames=labelnames,
buckets=build_1_2_5_buckets(max_model_len),
buckets=[
0.3,
0.5,
0.8,
1.0,
1.5,
2.0,
2.5,
5.0,
10.0,
15.0,
20.0,
30.0,
40.0,
50.0,
60.0,
],
)


Expand Down

0 comments on commit 588f2c3

Please sign in to comment.