public void Time(string operation, long miliseconds) { if (String.IsNullOrEmpty(operation) || miliseconds < 0) { return; } metricsCache.SetLatency(operation, miliseconds); }
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(); } }