MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / __init__

Method __init__

pymongo/synchronous/monitor.py:438–453  ·  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

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

Callers

nothing calls this directly

Calls 4

MovingAverageClass · 0.90
MovingMinimumClass · 0.90
_create_lockFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected