internal void Increment(long by, string metricName) { Interlocked.Increment(ref _occurance); if (metricName == null) { Interlocked.Add(ref _total, by); } else { NamedMetrics.AddOrUpdate(metricName, by, (i, t) => t + by); } }
internal void Increment(long by, string metricName) { if (metricName == "_Occurrence") { _occurance = by; _occuranceOveridden = true; } else { if (!_occuranceOveridden) { Interlocked.Increment(ref _occurance); } if (metricName == null || metricName == "_Total") { Interlocked.Add(ref _total, by); } else { NamedMetrics.AddOrUpdate(metricName, by, (i, t) => t + by); } } }