public StatsdData(
     Statsd statsd,
     StatsBufferize statsBufferize,
     StatsSender statsSender,
     Telemetry telemetry)
 {
     Statsd          = statsd;
     Telemetry       = telemetry;
     _statsBufferize = statsBufferize;
     _statsSender    = statsSender;
 }
 public StatsdData(
     MetricsSender metricsSender,
     StatsBufferize statsBufferize,
     ITransport transport,
     Telemetry telemetry)
 {
     MetricsSender   = metricsSender;
     Telemetry       = telemetry;
     _statsBufferize = statsBufferize;
     _transport      = transport;
 }
Esempio n. 3
0
 internal MetricsSender(
     StatsBufferize statsBufferize,
     IRandomGenerator randomGenerator,
     IStopWatchFactory stopwatchFactory,
     Telemetry optionalTelemetry,
     bool truncateIfTooLong,
     int poolMaxAllocation)
 {
     _stopwatchFactory  = stopwatchFactory;
     _statsBufferize    = statsBufferize;
     _randomGenerator   = randomGenerator;
     _optionalTelemetry = optionalTelemetry;
     _truncateIfTooLong = truncateIfTooLong;
     _pool = new Pool <Stats>(pool => new Stats(pool), poolMaxAllocation);
 }
Esempio n. 4
0
 internal MetricsSender(
     StatsBufferize statsBufferize,
     IRandomGenerator randomGenerator,
     IStopWatchFactory stopwatchFactory,
     Serializers serializers,
     Telemetry optionalTelemetry,
     bool truncateIfTooLong)
 {
     _stopwatchFactory  = stopwatchFactory;
     _statsBufferize    = statsBufferize;
     _randomGenerator   = randomGenerator;
     _optionalTelemetry = optionalTelemetry;
     _serializers       = serializers;
     _truncateIfTooLong = truncateIfTooLong;
 }
        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;
        }