[Bugfix][NIXL] Guard record_transfer against None telemetry (#57734)
Signed-off-by: The Anh Nguyen <ntheanh201@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user