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

Method add_sample

pymongo/synchronous/monitor.py:461–465  ·  view source on GitHub ↗

Add a RTT sample.

(self, sample: float)

Source from the content-addressed store, hash-verified

459 self._pool.reset()
460
461 def add_sample(self, sample: float) -> None:
462 """Add a RTT sample."""
463 with self._lock:
464 self._moving_average.add_sample(sample)
465 self._moving_min.add_sample(sample)
466
467 def get(self) -> tuple[Optional[float], float]:
468 """Get the calculated average, or None if no samples yet and the min."""

Callers 2

_runMethod · 0.95
_check_onceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected