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

Method average

src/sdam/monitor.ts:743–751  ·  view source on GitHub ↗

* Returns mean of samples contained in the buffer

()

Source from the content-addressed store, hash-verified

741 * Returns mean of samples contained in the buffer
742 */
743 average(): number {
744 if (this.length === 0) return 0;
745 let sum = 0;
746 for (let i = 0; i < this.length; i++) {
747 sum += this.rttSamples[i];
748 }
749
750 return sum / this.length;
751 }
752
753 /**
754 * Returns most recently inserted element in the buffer

Callers 2

monitor.test.tsFile · 0.80
roundTripTimeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected