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

Method measureAndReschedule

src/sdam/monitor.ts:517–532  ·  view source on GitHub ↗
(start: number, conn?: Connection)

Source from the content-addressed store, hash-verified

515 }
516
517 private measureAndReschedule(start: number, conn?: Connection) {
518 if (this.closed) {
519 conn?.destroy();
520 return;
521 }
522
523 if (this.connection == null) {
524 this.connection = conn;
525 }
526
527 this.latestRtt = calculateDurationInMs(start);
528 this.monitorId = setTimeout(
529 () => this.measureRoundTripTime(),
530 this.monitor.options.heartbeatFrequencyMS
531 );
532 }
533
534 private measureRoundTripTime() {
535 const start = processTimeMS();

Callers 1

measureRoundTripTimeMethod · 0.95

Calls 3

measureRoundTripTimeMethod · 0.95
calculateDurationInMsFunction · 0.90
destroyMethod · 0.45

Tested by

no test coverage detected