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

Method __init__

pymongo/asynchronous/monitor.py:440–455  ·  view source on GitHub ↗

Maintain round trip times for a server. The Topology is weakly referenced.

(self, topology: Topology, topology_settings: TopologySettings, pool: Pool)

Source from the content-addressed store, hash-verified

438
439class _RttMonitor(MonitorBase):
440 def __init__(self, topology: Topology, topology_settings: TopologySettings, pool: Pool):
441 """Maintain round trip times for a server.
442
443 The Topology is weakly referenced.
444 """
445 super().__init__(
446 topology,
447 "pymongo_server_rtt_task",
448 topology_settings.heartbeat_frequency,
449 common.MIN_HEARTBEAT_INTERVAL,
450 )
451
452 self._pool = pool
453 self._moving_average = MovingAverage()
454 self._moving_min = MovingMinimum()
455 self._lock = _async_create_lock()
456
457 async def close(self) -> None:
458 self.gc_safe_close()

Callers

nothing calls this directly

Calls 4

MovingAverageClass · 0.90
MovingMinimumClass · 0.90
_async_create_lockFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected