コード例 #1
0
 public StatsdData(
     Statsd statsd,
     StatsBufferize statsBufferize,
     StatsSender statsSender,
     Telemetry telemetry)
 {
     Statsd          = statsd;
     Telemetry       = telemetry;
     _statsBufferize = statsBufferize;
     _statsSender    = statsSender;
 }
コード例 #2
0
        public void Dispose()
        {
            // _statsBufferize and _telemetry must be disposed before _statsSender to make
            // sure _statsSender does not received data when it is already disposed.

            Telemetry?.Dispose();
            Telemetry = null;

            _statsBufferize?.Dispose();
            _statsBufferize = null;

            _statsSender?.Dispose();
            _statsSender = null;

            Statsd = null;
        }
コード例 #3
0
        private StatsBufferize CreateStatsBufferize(
            Telemetry telemetry,
            StatsSender statsSender,
            int bufferCapacity,
            AdvancedStatsConfig config)
        {
            var bufferHandler = new BufferBuilderHandler(telemetry, statsSender);
            var bufferBuilder = new BufferBuilder(bufferHandler, bufferCapacity, "\n");

            var statsBufferize = _factory.CreateStatsBufferize(
                telemetry,
                bufferBuilder,
                config.MaxMetricsInAsyncQueue,
                config.MaxBlockDuration,
                config.DurationBeforeSendingNotFullBuffer);

            return(statsBufferize);
        }