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

Method add_sample

pymongo/asynchronous/monitor.py:463–467  ·  view source on GitHub ↗

Add a RTT sample.

(self, sample: float)

Source from the content-addressed store, hash-verified

461 await self._pool.reset()
462
463 async def add_sample(self, sample: float) -> None:
464 """Add a RTT sample."""
465 async with self._lock:
466 self._moving_average.add_sample(sample)
467 self._moving_min.add_sample(sample)
468
469 async def get(self) -> tuple[Optional[float], float]:
470 """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