예제 #1
0
        public void Inc(double increment, long?timestamp)
        {
            if (ThreadSafeDouble.IsNaN(increment))
            {
                return;
            }

            IncInternal(increment, timestamp);
        }
예제 #2
0
        public void Dec(double decrement, long?timestamp)
        {
            if (ThreadSafeDouble.IsNaN(decrement))
            {
                return;
            }

            IncInternal(-decrement, timestamp);
        }
예제 #3
0
        public void Dec(double decrement, long?timestamp)
        {
            if (ThreadSafeDouble.IsNaN(decrement))
            {
                return;
            }

            _value.Add(-decrement);
            TimestampIfRequired(timestamp);
        }
예제 #4
0
        public void Observe(double val, long?timestamp)
        {
            if (ThreadSafeDouble.IsNaN(val))
            {
                return;
            }

            _bucketsStore.Observe(val);
            _sum.Add(val);
            TrackObservation(timestamp);
        }
예제 #5
0
        public void Inc(double increment, long?timestamp)
        {
            if (ThreadSafeDouble.IsNaN(increment))
            {
                return;
            }

            if (increment < 0.0D)
            {
                throw new ArgumentOutOfRangeException(nameof(increment), "Counter cannot go down");
            }

            IncInternal(increment, timestamp);
        }
예제 #6
0
        public void Inc(double increment, long?timestamp)
        {
            if (ThreadSafeDouble.IsNaN(increment))
            {
                return;
            }

            if (increment < 0.0D)
            {
                throw new ArgumentOutOfRangeException(nameof(increment), "Counter cannot go down");
            }

            _value.Add(increment);
            TimestampIfRequired(timestamp);
        }
예제 #7
0
        public void Observe(double val, long?timestamp)
        {
            if (ThreadSafeDouble.IsNaN(val))
            {
                return;
            }

            for (int i = 0; i < Configuration.Buckets.Count; i++)
            {
                if (val <= Configuration.Buckets[i])
                {
                    _bucketCounts[i].Add(1);
                    break;
                }
            }

            _sum.Add(val);
            TimestampIfRequired(timestamp);
        }