Example #1
0
        public GraphiteReporter(GraphiteConfiguration configuration, IGraphiteSwitch graphiteSwitch)
        {
            if (configuration.IpAddress == null)
            {
                return;
            }

            var       values = configuration.IpAddress.Split(':');
            IPAddress ipAddress;

            ipAddress = IPAddress.TryParse(values[0], out ipAddress) ? ipAddress : null;

            if (ipAddress == null)
            {
                return;
            }

            _graphiteSwitch    = graphiteSwitch;
            _iPEndPoint        = new IPEndPoint(ipAddress, 8125);
            _reportMachineName = configuration.ReportMachineName;
            _prefix            = configuration.Prefix;
            _udpClient         = new UdpClient();
#if (!NETSTANDARD1_6)
            _udpClient.Connect(_iPEndPoint);
#endif
        }
 public GraphiteMetricsReporterFactory(GraphiteConfiguration configuration, IGraphiteSwitch graphiteSwitch = null)
 {
     _configuration  = configuration;
     _graphiteSwitch = graphiteSwitch;
 }
 public GraphiteMetricsReporterFactory(string ipAddress, string prefix = "", bool reportMachineName = false, IGraphiteSwitch graphiteSwitch = null)
 {
     _configuration  = new GraphiteConfiguration(ipAddress, reportMachineName, prefix);
     _graphiteSwitch = graphiteSwitch;
 }