[Bugfix][NIXL] Guard record_transfer against None telemetry (#57734)

Signed-off-by: The Anh Nguyen <ntheanh201@gmail.com>
This commit is contained in:
The Anh Nguyen
2026-10-09 08:22:18 +00:00
committed by GitHub
parent 560fae64cd
commit bacbbe1878
@@ -44,8 +44,10 @@ class NixlKVConnectorStats(KVConnectorStats):
"num_notifications_after_expiry": [],
}
def record_transfer(self, res: "nixlXferTelemetry"):
def record_transfer(self, res: "nixlXferTelemetry | None"):
# Keep metrics units consistent with rest of the code: time us->s
if res is None:
return
self.data["transfer_duration"].append(res.xferDuration / 1e6)
self.data["post_duration"].append(res.postDuration / 1e6)
self.data["bytes_transferred"].append(res.totalBytes)