示例#1
0
 protected MetricValueSource(string name, IMetricValueProvider <T> valueProvider, Unit unit, MetricTags tags)
 {
     Name          = name;
     Unit          = unit;
     ValueProvider = valueProvider;
     Tags          = tags;
 }
示例#2
0
 public TimerValueSource(string name, IMetricValueProvider <TimerValue> value, Unit unit, TimeUnit rateUnit, TimeUnit durationUnit,
                         MetricTags tags)
     : base(name, new ScaledValueProvider <TimerValue>(value, v => v.Scale(rateUnit, durationUnit)), unit, tags)
 {
     RateUnit     = rateUnit;
     DurationUnit = durationUnit;
 }
示例#3
0
 public ApdexValueSource(string name, IMetricValueProvider <ApdexValue> value,
                         MetricTags tags,
                         bool resetOnReporting = false)
     : base(name, value, Unit.Results, tags)
 {
     ResetOnReporting = resetOnReporting;
 }
示例#4
0
 public GaugeValueSource(
     string name,
     IMetricValueProvider <double> value,
     Unit unit,
     MetricTags tags)
     : base(name, value, unit, tags)
 {
 }
示例#5
0
 public HistogramValueSource(
     string name,
     IMetricValueProvider <HistogramValue> valueProvider,
     Unit unit,
     MetricTags tags)
     : base(name, valueProvider, unit, tags)
 {
 }
示例#6
0
 protected MetricValueSourceBase(string name, string group, IMetricValueProvider <T> valueProvider, Unit unit, MetricTags tags)
 {
     Name          = name;
     Group         = group;
     Unit          = unit;
     ValueProvider = valueProvider;
     Tags          = tags;
 }
示例#7
0
 internal StreamMetric(
     MetricName metricName,
     IMetricValueProvider metricValueProvider,
     MetricConfig config)
 {
     this.metricName          = metricName;
     this.metricValueProvider = metricValueProvider;
     this.config = config;
 }
示例#8
0
 public GaugeValueSource(
     string name,
     IMetricValueProvider <double> value,
     Unit unit,
     MetricTags tags,
     bool restOnReporting = false)
     : base(name, value, unit, tags, restOnReporting)
 {
 }
示例#9
0
 public HistogramValueSource(
     string name,
     IMetricValueProvider <HistogramValue> valueProvider,
     Unit unit,
     MetricTags tags,
     bool restOnReporting = false)
     : base(name, valueProvider, unit, tags, restOnReporting)
 {
 }
示例#10
0
 public MeterValueSource(
     string name,
     string group,
     IMetricValueProvider <MeterValue> value,
     Unit unit,
     TimeUnit rateUnit,
     MetricTags tags)
     : base(name, group, new ScaledValueProvider <MeterValue>(value, v => v.Scale(rateUnit)), unit, tags)
 {
     RateUnit = rateUnit;
 }
示例#11
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="CounterValueSource" /> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="value">The value.</param>
 /// <param name="unit">The unit.</param>
 /// <param name="tags">The tags.</param>
 /// <param name="resetOnReporting">if set to <c>true</c> [reset on reporting]. Defaults to <c>false</c>.</param>
 /// <param name="reportItemPercentages">if set to <c>true</c> [report item percentages]. Defaults to <c>true</c></param>
 /// <param name="reportSetItems">if set to <c>true</c> [report set items]. Defaults to <c>true</c></param>
 public CounterValueSource(string name, IMetricValueProvider <CounterValue> value,
                           Unit unit, MetricTags tags,
                           bool resetOnReporting      = false,
                           bool reportItemPercentages = true,
                           bool reportSetItems        = true)
     : base(name, value, unit, tags)
 {
     ResetOnReporting      = resetOnReporting;
     ReportItemPercentages = reportItemPercentages;
     ReportSetItems        = reportSetItems;
 }
示例#12
0
 public MeterValueSource(
     string name,
     IMetricValueProvider <MeterValue> value,
     Unit unit,
     TimeUnit rateUnit,
     MetricTags tags,
     bool reportSetItems = true)
     : base(name, new ScaledValueProvider <MeterValue>(value, v => v.Scale(rateUnit)), unit, tags)
 {
     RateUnit       = rateUnit;
     ReportSetItems = reportSetItems;
 }
示例#13
0
        protected MetricValueSourceBase(string name, IMetricValueProvider <T> valueProvider, Unit unit, MetricTags tags)
        {
            Name          = name;
            Unit          = unit;
            ValueProvider = valueProvider;
            Tags          = tags;

            if (name.Contains(AppMetricsFormattingConstants.MetricName.DimensionSeparator))
            {
                IsMultidimensional   = true;
                MultidimensionalName =
                    name.Split(new[] { AppMetricsFormattingConstants.MetricName.DimensionSeparator }, StringSplitOptions.RemoveEmptyEntries)[0];
            }
        }
 public CounterValueSource(string name, IMetricValueProvider <CounterValue> value, Unit unit, MetricTags tags)
     : base(name, value, unit, tags)
 {
 }
示例#15
0
 public bool Merge(IMetricValueProvider <CounterValue> other)
 {
     return(true);
 }
示例#16
0
 public ScaledValueProvider(IMetricValueProvider <T> valueProvider, Func <T, T> transformation)
 {
     ValueProvider    = valueProvider;
     _scalingFunction = transformation;
 }
示例#17
0
 public DerivedGauge(IMetricValueProvider <double> gauge, Func <double, double> transformation)
 {
     _gauge          = gauge;
     _transformation = transformation;
 }