MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _ping

Method _ping

pymongo/asynchronous/monitor.py:493–500  ·  view source on GitHub ↗

Run a "hello" command and return the RTT.

(self)

Source from the content-addressed store, hash-verified

491 await self._pool.reset()
492
493 async def _ping(self) -> float:
494 """Run a "hello" command and return the RTT."""
495 async with self._pool.checkout() as conn:
496 if self._executor._stopped:
497 raise Exception("_RttMonitor closed")
498 start = time.monotonic()
499 await conn.hello()
500 return _monotonic_duration(start)
501
502
503# Close monitors to cancel any in progress streaming checks before joining

Callers 1

_runMethod · 0.95

Calls 3

_monotonic_durationFunction · 0.70
checkoutMethod · 0.45
helloMethod · 0.45

Tested by

no test coverage detected