Dispose() public method

public Dispose ( ) : void
return void
Beispiel #1
0
        private static void CreateStatsD(MetricsConfig config)
        {
            if (_statsdUdp != null)
            {
                _statsdUdp.Dispose();
            }

            _statsdUdp = null;

            if (!string.IsNullOrEmpty(config.StatsdServerName))
            {
                _statsdUdp = new StatsdUDP(config.StatsdServerName, config.StatsdServerPort, config.StatsdMaxUDPPacketSize);
                _statsD    = new Statsd(_statsdUdp);
            }
        }
        private static void CreateStatsD(MetricsConfig config)
        {
            if (_statsdUdp != null)
            {
                _statsdUdp.Dispose();
            }

            _statsdUdp = null;

            if (!string.IsNullOrEmpty(config.StatsdServerName))
            {
                _statsdUdp = new StatsdUDP(config.StatsdServerName, config.StatsdServerPort, config.StatsdMaxUDPPacketSize);
                _statsD    = new Statsd(new Statsd.Configuration()
                {
                    Udp = _statsdUdp, Sender = config.Sender, Prefix = _prefix, GlobalTags = config.GlobalTags, TagScopes = _tagScopes
                });
            }
        }