private DefaultMetricsSourceImpl( [Parameter(typeof(DefaultMetricsSourceParameters.ContextOrTaskName))] string contextOrTaskName, [Parameter(typeof(DefaultMetricsSourceParameters.EvaluatorId))] string evaluatorId, [Parameter(typeof(DefaultMetricsSourceParameters.SourceContext))] string sourceContext, [Parameter(typeof(DefaultMetricsSourceParameters.RecordName))] string recordName, IMetricsFactory metricsFactory) { _contextOrTaskName = contextOrTaskName; _evaluatorId = evaluatorId; _sourceContext = sourceContext; _recordName = recordName; _metricsFactory = metricsFactory; _counters = new MutableMetricContainer<ICounter>( (name, desc) => metricsFactory.CreateCounter(name, desc), this); _longGauges = new MutableMetricContainer<ILongGauge>( (name, desc) => metricsFactory.CreateLongGauge(name, desc), this); _doubleGauges = new MutableMetricContainer<IDoubleGauge>( (name, desc) => metricsFactory.CreateDoubleGauge(name, desc), this); _rates = new MutableMetricContainer<IRate>( (name, desc) => metricsFactory.CreateRateMetric(name, desc), this); }
private DefaultMetricsSourceImpl( [Parameter(typeof(DefaultMetricsSourceParameters.ContextOrTaskName))] string contextOrTaskName, [Parameter(typeof(DefaultMetricsSourceParameters.EvaluatorId))] string evaluatorId, [Parameter(typeof(DefaultMetricsSourceParameters.SourceContext))] string sourceContext, [Parameter(typeof(DefaultMetricsSourceParameters.RecordName))] string recordName, IMetricsFactory metricsFactory) { _contextOrTaskName = contextOrTaskName; _evaluatorId = evaluatorId; _sourceContext = sourceContext; _recordName = recordName; _metricsFactory = metricsFactory; _counters = new MutableMetricContainer <ICounter>( (name, desc) => metricsFactory.CreateCounter(name, desc), this); _longGauges = new MutableMetricContainer <ILongGauge>( (name, desc) => metricsFactory.CreateLongGauge(name, desc), this); _doubleGauges = new MutableMetricContainer <IDoubleGauge>( (name, desc) => metricsFactory.CreateDoubleGauge(name, desc), this); _rates = new MutableMetricContainer <IRate>( (name, desc) => metricsFactory.CreateRateMetric(name, desc), this); }