Esempio n. 1
0
        public void Time(string operation, long miliseconds)
        {
            if (String.IsNullOrEmpty(operation) || miliseconds < 0)
            {
                return;
            }

            metricsCache.SetLatency(operation, miliseconds);
        }
Esempio n. 2
0
        public void Time(string operation, long miliseconds)
        {
            if (string.IsNullOrEmpty(operation) || miliseconds < 0)
            {
                return;
            }

            metricsCache.SetLatency(operation, miliseconds);

            var oldLastCall = timeLastCall;

            timeLastCall = DateTime.UtcNow;
            if ((timeLastCall - oldLastCall).TotalMilliseconds > maxTimeBetweenCalls)
            {
                SendTimeMetrics();
            }
        }