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

Method _ping

pymongo/synchronous/monitor.py:491–498  ·  view source on GitHub ↗

Run a "hello" command and return the RTT.

(self)

Source from the content-addressed store, hash-verified

489 self._pool.reset()
490
491 def _ping(self) -> float:
492 """Run a "hello" command and return the RTT."""
493 with self._pool.checkout() as conn:
494 if self._executor._stopped:
495 raise Exception("_RttMonitor closed")
496 start = time.monotonic()
497 conn.hello()
498 return _monotonic_duration(start)
499
500
501# 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