示例#1
0
        public void Gauge(string gauge, long value)
        {
            if (String.IsNullOrEmpty(gauge) || value < 0)
            {
                return;
            }

            metricsCache.SetGauge(gauge, value);
        }
示例#2
0
        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();
            }
        }