MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / _monitor_cb

Function _monitor_cb

lightx2v/disagg/examples/run_controller.py:401–416  ·  view source on GitHub ↗
(results: list[dict[str, Any]])

Source from the content-addressed store, hash-verified

399 if worker_count <= 0:
400 raise RuntimeError("no workers launched, please check --num_workers / --gpus / parallel config")
401
402 monitor_nodes = [f"tcp://127.0.0.1:{args.worker_monitor_base_port + i}" for i in range(worker_count)]
403 monitor = Monitor(monitor_nodes)
404 monitor_samples: list[dict[str, Any]] = []
405 monitor_stop_event = threading.Event()
406 global_first_send_ts: float | None = None
407
408 def _monitor_cb(results: list[dict[str, Any]]) -> None:
409 ts = time.time()
410 for item in results:
411 sample = dict(item)
412 sample["sample_ts"] = ts
413 sample["sample_ts_from_global_start_s"] = ts - global_first_send_ts if global_first_send_ts is not None else None
414 monitor_samples.append(sample)
415 status = sample.get("status")
416 # if status == "ok":
417 # logger.info(
418 # "[monitor] {} gpu_util={} mem={}/{} MB",
419 # sample.get("address"),

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected