File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ def metrics(slurm_job_id: str) -> None:
447447 metrics_formatter .format_metrics ()
448448
449449 live .update (metrics_formatter .table )
450- time .sleep (2 )
450+ time .sleep (1 )
451451 except click .ClickException as e :
452452 raise e
453453 except Exception as e :
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ class VecInfClient:
8181
8282 def __init__ (self ) -> None :
8383 """Initialize the Vector Inference client."""
84- pass
84+ self . _metrics_collectors : dict [ str , PerformanceMetricsCollector ] = {}
8585
8686 def list_models (self ) -> list [ModelInfo ]:
8787 """List all available models.
@@ -218,7 +218,11 @@ def get_metrics(self, slurm_job_id: str) -> MetricsResponse:
218218 - Performance metrics or error message
219219 - Timestamp of collection
220220 """
221- performance_metrics_collector = PerformanceMetricsCollector (slurm_job_id )
221+ # Use cached collector to preserve state between calls for throughput calculation
222+ if slurm_job_id not in self ._metrics_collectors :
223+ self ._metrics_collectors [slurm_job_id ] = PerformanceMetricsCollector (slurm_job_id )
224+
225+ performance_metrics_collector = self ._metrics_collectors [slurm_job_id ]
222226
223227 metrics : Union [dict [str , float ], str ]
224228 if not performance_metrics_collector .metrics_url .startswith ("http" ):
You can’t perform that action at this time.
0 commit comments