Exemplo n.º 1
0
        private async Task FlushTracesAsync()
        {
            var traces    = _tracesBuffer.Pop();
            var spanCount = traces.Sum(t => t.Count);

            if (_statsd != null)
            {
                _statsd.AppendSetGauge(TracerMetricNames.Queue.DequeuedTraces, traces.Count);
                _statsd.AppendSetGauge(TracerMetricNames.Queue.DequeuedSpans, spanCount);
                _statsd.AppendSetGauge(TracerMetricNames.Queue.MaxCapacity, TraceBufferSize);
                _statsd.Send();
            }

            if (traces.Any())
            {
                await _api.SendTracesAsync(traces).ConfigureAwait(false);
            }
        }
Exemplo n.º 2
0
        public async Task FlushTracesAsync()
        {
            var traces = _tracesBuffer.Pop();

            if (_statsd != null)
            {
                var spanCount = traces.Sum(t => t.Length);

                _statsd.AppendIncrementCount(TracerMetricNames.Queue.DequeuedTraces, traces.Length);
                _statsd.AppendIncrementCount(TracerMetricNames.Queue.DequeuedSpans, spanCount);
                _statsd.AppendSetGauge(TracerMetricNames.Queue.MaxTraces, TraceBufferSize);
                _statsd.Send();
            }

            if (traces.Length > 0)
            {
                await _api.SendTracesAsync(traces).ConfigureAwait(false);
            }
        }