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

Class ServerHeartbeatHandler

test/lambda/mongodb/app.py:54–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54class ServerHeartbeatHandler(ServerHeartbeatListener):
55 def started(self, event):
56 print("server heartbeat started", event)
57
58 def succeeded(self, event):
59 global heartbeat_count, total_heartbeat_duration, streaming_heartbeat_count
60 heartbeat_count += 1
61 total_heartbeat_duration += event.duration
62 if event.awaited:
63 streaming_heartbeat_count += 1
64 print("server heartbeat succeeded", event)
65
66 def failed(self, event):
67 global heartbeat_count, total_heartbeat_duration
68 heartbeat_count += 1
69 total_heartbeat_duration += event.duration
70 print("server heartbeat failed", event)
71
72
73class ConnectionHandler(ConnectionPoolListener):

Callers 1

app.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected