Ejemplo n.º 1
0
        /// <inheritDoc/>
        public void Report(double value)
        {
            // Currently we accept there are race conditions here, we could get around it with a lock but frankly it's probably ok
            // until proven otherwise
            InterlockedDouble.Add(ref sum, value);

            for (int i = 0; i < bucketUpperBounds.Length; i++)
            {
                if (value < bucketUpperBounds[i])
                {
                    Interlocked.Increment(ref bucketCounts[i]);
                }
            }
        }
Ejemplo n.º 2
0
 /// <inheritDoc/>
 public void Increment(double value)
 {
     InterlockedDouble.Add(ref this.value, value);
 }