Пример #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);
        }