public static IReportFactory AddGraphite( this IReportFactory factory, GraphiteReporterSettings settings, IFilterMetrics filter = null) { factory.AddProvider(new GraphiteReporterProvider(settings, filter)); return(factory); }
public GraphiteReporterProvider(GraphiteReporterSettings settings, IFilterMetrics filter) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } _settings = settings; Filter = filter; }
public static IReportFactory AddGraphite( this IReportFactory factory, string host, int port, ConnectionType connectionType = ConnectionType.Tcp, string metricTemplate = null, IFilterMetrics filter = null) { var settings = new GraphiteReporterSettings { Host = host, Port = port, ConnectionType = connectionType, MetricNameFormatter = string.IsNullOrEmpty(metricTemplate) ? new GraphiteMetricNameFormatter() : new GraphiteMetricNameFormatter(metricTemplate) }; factory.AddGraphite(settings, filter); return(factory); }
public GraphiteReporterProvider(GraphiteReporterSettings settings, IFilterMetrics fitler) { _settings = settings ?? throw new ArgumentNullException(nameof(settings)); Filter = fitler ?? new NoOpMetricsFilter(); }