private static void AddStatsMetric(GaugeAggregator aggregator, string statName, double value) { var statsMetric = new StatsMetric { MetricType = MetricType.Gauge, StatName = statName, NumericValue = value, }; aggregator.OnNewValue(ref statsMetric); }
private bool RouteMetric(ref StatsMetric metric) { switch (metric.MetricType) { case MetricType.Count: if (_optionalCountAggregator != null) { _optionalCountAggregator.OnNewValue(ref metric); return(false); } break; case MetricType.Gauge: if (_optionalGaugeAggregator != null) { _optionalGaugeAggregator.OnNewValue(ref metric); return(false); } break; case MetricType.Set: if (_optionalSetAggregator != null) { _optionalSetAggregator.OnNewValue(ref metric); return(false); } break; default: break; } this._serializers.MetricSerializer.SerializeTo(ref metric, _serializedMetric); return(true); }