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):
5050 documentation = "The percentage of decode slots currently being used" ,
5151 labelnames = ["id" , "idx" ],
5252 )
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+ )
5358
5459 def get_prefill_backlog_metric (self ):
5560 return self ._prefill_backlog .labels (id = self ._id )
@@ -62,3 +67,6 @@ def get_generate_backlog_metric(self, idx: int):
6267
6368 def get_slots_used_percentage_metric (self , idx : int ):
6469 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 2323import os
2424import signal
2525import threading
26+ import time
2627import traceback
2728from typing import Any , Type
2829
@@ -122,6 +123,9 @@ def run(
122123 Returns:
123124 JetStreamServer that wraps the grpc server and orchestrator driver.
124125 """
126+
127+ server_start_time = time .time ()
128+
125129 logging .info ("Kicking off gRPC server." )
126130 engines = config_lib .get_engines (config , devices = devices )
127131 prefill_params = [pe .load_params () for pe in engines .prefill_engines ]
@@ -196,6 +200,11 @@ def run(
196200
197201 jetstream_server .start ()
198202
203+ if metrics_collector :
204+ metrics_collector .get_server_startup_latency_metric ().set (
205+ time .time () - server_start_time
206+ )
207+
199208 # Setup Jax Profiler
200209 if enable_jax_profiler :
201210 logging .info ("Starting JAX profiler server on port %s" , jax_profiler_port )
You can’t perform that action at this time.
0 commit comments