Esempio 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]);
                }
            }
        }
 /// <inheritDoc/>
 public void Increment(double value)
 {
     InterlockedDouble.Add(ref this.value, value);
 }