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

Method addSample

src/sdam/monitor.ts:717–724  ·  view source on GitHub ↗

* Adds an rtt sample to the end of the circular buffer * When `windowSize` samples have been collected, `addSample` overwrites the least recently added * sample

(sample: number)

Source from the content-addressed store, hash-verified

715 * sample
716 */
717 addSample(sample: number) {
718 this.rttSamples[this.writeIndex++] = sample;
719 if (this.length < this.rttSamples.length) {
720 this.length++;
721 }
722
723 this.writeIndex %= this.rttSamples.length;
724 }
725
726 /**
727 * When \< 2 samples have been collected, returns 0

Callers 2

monitor.test.tsFile · 0.80
addRttSampleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected