コード例 #1
0
        /// <inheritdoc/>
        protected override void Write(IMetricReadingBatch batch, DateTime timestamp)
        {
            var countSnapshot = Interlocked.Exchange(ref _count, 0);

            if (countSnapshot == 0)
            {
                return;
            }

            batch.Add(
                CreateReading(countSnapshot, timestamp)
                );
        }
コード例 #2
0
ファイル: SnapshotGauge.cs プロジェクト: joaomasters/trabalho
        /// <inheritdoc/>
        protected override void Write(IMetricReadingBatch batch, DateTime timestamp)
        {
            var val = _getValueFunc();

            if (!val.HasValue || double.IsNaN(val.Value))
            {
                return;
            }

            batch.Add(
                CreateReading(val.Value, timestamp)
                );
        }
コード例 #3
0
        /// <inheritdoc/>
        protected override void Write(IMetricReadingBatch batch, DateTime timestamp)
        {
            var val = _getCountFunc();

            if (!val.HasValue || val.Value == 0)
            {
                return;
            }

            batch.Add(
                CreateReading(val.Value, timestamp)
                );
        }
コード例 #4
0
ファイル: SamplingGauge.cs プロジェクト: joaomasters/trabalho
        /// <inheritdoc/>
        protected override void Write(IMetricReadingBatch batch, DateTime timestamp)
        {
            var value = Interlocked.Exchange(ref _value, double.NaN);

            if (double.IsNaN(value))
            {
                return;
            }

            batch.Add(
                CreateReading(value, timestamp)
                );
        }
コード例 #5
0
        /// <inheritdoc/>
        protected override void Write(IMetricReadingBatch batch, DateTime timestamp)
        {
            var pending = Interlocked.Exchange(ref _pendingMetrics, new ConcurrentBag <PendingMetric>());

            if (pending == null || pending.Count == 0)
            {
                return;
            }

            foreach (var p in pending)
            {
                batch.Add(
                    CreateReading(p.Value, p.Time)
                    );
            }
        }