public void Gauge(string gauge, long value) { if (String.IsNullOrEmpty(gauge) || value < 0) { return; } metricsCache.SetGauge(gauge, value); }
public void Gauge(string gauge, long value) { if (string.IsNullOrEmpty(gauge) || value < 0) { return; } metricsCache.SetGauge(gauge, value); gaugeCallCount++; var oldLastCall = gaugeLastCall; gaugeLastCall = DateTime.UtcNow; if (gaugeCallCount >= maxCountCalls || (gaugeLastCall - oldLastCall).TotalMilliseconds > maxTimeBetweenCalls) { SendGaugeMetrics(); } }