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

Method enable

test/helpers.py:62–81  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

60 self._stack = None
61
62 def enable(self):
63 self.old_heartbeat_frequency = common.HEARTBEAT_FREQUENCY
64 self.old_min_heartbeat_interval = common.MIN_HEARTBEAT_INTERVAL
65 self.old_kill_cursor_frequency = common.KILL_CURSOR_FREQUENCY
66 self.old_events_queue_frequency = common.EVENTS_QUEUE_FREQUENCY
67
68 if self.heartbeat_frequency is not None:
69 common.HEARTBEAT_FREQUENCY = self.heartbeat_frequency
70
71 if self.min_heartbeat_interval is not None:
72 common.MIN_HEARTBEAT_INTERVAL = self.min_heartbeat_interval
73
74 if self.kill_cursor_frequency is not None:
75 common.KILL_CURSOR_FREQUENCY = self.kill_cursor_frequency
76
77 if self.events_queue_frequency is not None:
78 common.EVENTS_QUEUE_FREQUENCY = self.events_queue_frequency
79 self._enabled = True
80 # Store the allocation traceback to catch non-disabled client_knobs.
81 self._stack = "".join(traceback.format_stack())
82
83 def __enter__(self):
84 self.enable()

Callers 7

__enter__Method · 0.95
setUpMethod · 0.45
setUpClassMethod · 0.45
setUpMethod · 0.45
setupFunction · 0.45
setUpMethod · 0.45
setUpClassMethod · 0.45

Calls 1

joinMethod · 0.45

Tested by 3

setUpMethod · 0.36
setUpClassMethod · 0.36
setUpMethod · 0.36