Skip to content

Commit fc143ff

Browse files
committed
PYTHON-5846 Fix durationMS unit in CMAP log entries (seconds -> milliseconds)
1 parent 577b594 commit fc143ff

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pymongo/_telemetry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def connection_ready(self, conn_id: int) -> None:
280280
self._emit_log(
281281
_ConnectionStatusMessage.CONN_READY,
282282
driverConnectionId=conn_id,
283-
durationMS=duration,
283+
durationMS=duration * 1000,
284284
)
285285
if self._should_publish:
286286
assert self._listeners is not None
@@ -312,7 +312,7 @@ def checkout_succeeded(self, conn_id: int) -> None:
312312
self._emit_log(
313313
_ConnectionStatusMessage.CHECKOUT_SUCCEEDED,
314314
driverConnectionId=conn_id,
315-
durationMS=duration,
315+
durationMS=duration * 1000,
316316
)
317317

318318
def checkout_failed(self, reason: str, error: str) -> None:
@@ -324,7 +324,7 @@ def checkout_failed(self, reason: str, error: str) -> None:
324324
_ConnectionStatusMessage.CHECKOUT_FAILED,
325325
reason=reason,
326326
error=error,
327-
durationMS=duration,
327+
durationMS=duration * 1000,
328328
)
329329

330330
def checked_in(self, conn_id: int) -> None:

0 commit comments

Comments
 (0)