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

Method get

pymongo/read_preferences.py:632–634  ·  view source on GitHub ↗

Get the calculated average, or None if no samples yet.

(self)

Source from the content-addressed store, hash-verified

630 self.average = 0.8 * self.average + 0.2 * sample
631
632 def get(self) -> Optional[float]:
633 """Get the calculated average, or None if no samples yet."""
634 return self.average
635
636 def reset(self) -> None:
637 self.average = None

Callers 4

run_scenarioFunction · 0.95
test_moving_averageMethod · 0.95
run_scenarioFunction · 0.95
test_moving_averageMethod · 0.95

Calls

no outgoing calls

Tested by 4

run_scenarioFunction · 0.76
test_moving_averageMethod · 0.76
run_scenarioFunction · 0.76
test_moving_averageMethod · 0.76