File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,11 @@ def __new__(cls):
50
50
documentation = "The percentage of decode slots currently being used" ,
51
51
labelnames = ["id" , "idx" ],
52
52
)
53
+ _server_startup_latency = Gauge (
54
+ name = "jetstream_server_startup_latency" ,
55
+ documentation = "Total time taken to start the Jetstream server" ,
56
+ labelnames = ["id" ],
57
+ )
53
58
54
59
def get_prefill_backlog_metric (self ):
55
60
return self ._prefill_backlog .labels (id = self ._id )
@@ -62,3 +67,6 @@ def get_generate_backlog_metric(self, idx: int):
62
67
63
68
def get_slots_used_percentage_metric (self , idx : int ):
64
69
return self ._slots_used_percentage .labels (id = self ._id , idx = idx )
70
+
71
+ def get_server_startup_latency_metric (self ):
72
+ return self ._server_startup_latency .labels (id = self ._id )
Original file line number Diff line number Diff line change 23
23
import os
24
24
import signal
25
25
import threading
26
+ import time
26
27
import traceback
27
28
from typing import Any , Type
28
29
@@ -122,6 +123,9 @@ def run(
122
123
Returns:
123
124
JetStreamServer that wraps the grpc server and orchestrator driver.
124
125
"""
126
+
127
+ server_start_time = time .time ()
128
+
125
129
logging .info ("Kicking off gRPC server." )
126
130
engines = config_lib .get_engines (config , devices = devices )
127
131
prefill_params = [pe .load_params () for pe in engines .prefill_engines ]
@@ -196,6 +200,11 @@ def run(
196
200
197
201
jetstream_server .start ()
198
202
203
+ if metrics_collector :
204
+ metrics_collector .get_server_startup_latency_metric ().set (
205
+ time .time () - server_start_time
206
+ )
207
+
199
208
# Setup Jax Profiler
200
209
if enable_jax_profiler :
201
210
logging .info ("Starting JAX profiler server on port %s" , jax_profiler_port )
You can’t perform that action at this time.
0 commit comments