예제 #1
0
 public static IReportFactory AddGraphite(
     this IReportFactory factory,
     GraphiteReporterSettings settings,
     IFilterMetrics filter = null)
 {
     factory.AddProvider(new GraphiteReporterProvider(settings, filter));
     return(factory);
 }
예제 #2
0
        public GraphiteReporterProvider(GraphiteReporterSettings settings, IFilterMetrics filter)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            _settings = settings;
            Filter    = filter;
        }
예제 #3
0
        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);
        }
예제 #4
0
 public GraphiteReporterProvider(GraphiteReporterSettings settings, IFilterMetrics fitler)
 {
     _settings = settings ?? throw new ArgumentNullException(nameof(settings));
     Filter    = fitler ?? new NoOpMetricsFilter();
 }