private void ProcessCurrentValue(MetricsEnvelope counterData) { foreach (string name in counterData.Data?.Keys) { var value = counterData.Data[name]; MetricKey key = GetMetrickKey(counterData, name); _lastValues[key] = value; } }
private void ProcessIncrementValue(MetricsEnvelope counterData) { foreach (var name in counterData.Data?.Keys) { var value = counterData.Data[name]; MetricKey key = GetMetrickKey(counterData, name); IncrementValue(_accumulatedValues, key, value); } }
private void IncrementValue(IDictionary <MetricKey, MetricValue> values, MetricKey key, MetricValue value) { _accumulatedValues.TryGetValue(key, out MetricValue previousValue); if (previousValue == null) { _accumulatedValues[key] = value; } else { previousValue.Increment(value); } }