MCPcopy
hub / github.com/mongodb/node-mongodb-native / resetMonitorState

Function resetMonitorState

src/sdam/monitor.ts:230–243  ·  view source on GitHub ↗
(monitor: Monitor)

Source from the content-addressed store, hash-verified

228}
229
230function resetMonitorState(monitor: Monitor) {
231 monitor.monitorId?.stop();
232 monitor.monitorId = undefined;
233
234 monitor.rttPinger?.close();
235 monitor.rttPinger = undefined;
236
237 monitor.cancellationToken.emit('cancel');
238
239 monitor.connection?.destroy();
240 monitor.connection = null;
241
242 monitor.clearRttSamples();
243}
244
245function useStreamingProtocol(monitor: Monitor, topologyVersion: TopologyVersion | null): boolean {
246 // If we have no topology version we always poll no matter

Callers 2

resetMethod · 0.85
closeMethod · 0.85

Calls 5

clearRttSamplesMethod · 0.80
emitMethod · 0.65
stopMethod · 0.45
closeMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected