Esempio n. 1
0
 private void CheckBuffer(AccumulatingCircularBuffer <long, float> buffer, long[] values, float accumulatedValue)
 {
     CollectionAssert.AreEqual(values, buffer.ToArray());
     Assert.AreEqual(accumulatedValue, buffer.AccumulatedValue());
 }
Esempio n. 2
0
 /// <summary>
 /// Return the average bytes-per-window. If each window is 100ms, then this
 /// should be multiplied by 10 to get bytes-per-second.
 /// </summary>
 /// <returns>Average bandwidth over the previous n windows, where n is the
 /// capacity of the class, in units of bytes per window</returns>
 public float BytesPerWindow()
 {
     return(previousBytesTransferred.AccumulatedValue());
 }