private void SetupStatsD(IStatsDConfiguration configuration) { IPAddress address = Helpers.ParseAddress(configuration.Address); // Initialize with ip address. IPipe inner = new UdpPipe(address, configuration.Port); this.statsdPipe = new SamplingPipe(inner); }
public StatsDBackend(IStatsDConfiguration configuration) { this.factory = new ChannelFactory(null, configuration); this.channels = new Dictionary <string, IMonitoringChannel> { { MetricType.Counter, this.factory.CreateChannel("counter", "statsd") }, { MetricType.Gauge, this.factory.CreateChannel("gauge", "statsd") }, { MetricType.Timing, this.factory.CreateChannel("timing", "statsd") }, }; }
public StatsDBackend(IStatsDConfiguration configuration) { this.factory = new ChannelFactory(null, configuration); this.channels = new Dictionary<string, IMonitoringChannel> { { MetricType.Counter, this.factory.CreateChannel("counter", "statsd") }, { MetricType.Gauge, this.factory.CreateChannel("gauge", "statsd") }, { MetricType.Timing, this.factory.CreateChannel("timing", "statsd") }, }; }
private void SetupPipes(IGraphiteConfiguration graphite, IStatsDConfiguration statsd) { if (graphite != null && !string.IsNullOrWhiteSpace(graphite.Address)) { this.SetupGraphite(graphite); this.graphitePrefix = graphite.PrefixKey; } if (statsd != null && !string.IsNullOrWhiteSpace(statsd.Address)) { this.SetupStatsD(statsd); this.statsdPrefix = statsd.PrefixKey; } }
public OutputFactory(IGraphiteConfiguration graphiteConfiguration, IStatsDConfiguration statsDConfiguration) { this.graphiteConfiguration = graphiteConfiguration; this.statsDConfiguration = statsDConfiguration; }
/// <summary> /// Initializes a new instance of the <see cref="ChannelFactory" /> class. /// </summary> /// <param name="graphite">The graphite configuration.</param> /// <param name="statsd">The statsd configuration.</param> /// <exception cref="System.ArgumentException">Invalid configuration values.</exception> public ChannelFactory(IGraphiteConfiguration graphite, IStatsDConfiguration statsd) { this.formatters = new FormatterFactory(); this.SetupPipes(graphite, statsd); }