public void Configure(string collectorName, XElement configElement, ISystemMetricsService systemMetrics) { _systemMetrics = systemMetrics; var config = new StatsdBackendConfiguration(configElement.Attribute("host").Value, configElement.ToInt("port"), Utility.ConvertToTimespan(configElement.Attribute("flushInterval").Value), configElement.ToBoolean("enableCompression", true)); _client = new StatsdnetForwardingClient(config.Host, config.Port, _systemMetrics); _bufferBlock = new TimedBufferBlock <GraphiteLine[]>(config.FlushInterval, PostMetrics); Completion = new Task(() => { IsActive = false; }); IsActive = true; }
public void Configure(string collectorName, XElement configElement, ISystemMetricsService systemMetrics) { _systemMetrics = systemMetrics; var config = new StatsdBackendConfiguration(configElement.Attribute("host").Value, configElement.ToInt("port"), Utility.ConvertToTimespan(configElement.Attribute("flushInterval").Value), configElement.ToBoolean("enableCompression", true)); _client = new StatsdnetForwardingClient(config.Host, config.Port, _systemMetrics); _bufferBlock = new TimedBufferBlock<GraphiteLine[]>(config.FlushInterval, PostMetrics); _completionTask = new Task(() => { _isActive = false; }); _isActive = true; }