private void ActualiseCurrentMetric_NeedsLock() { long now = SystemClock.UtcNow().Ticks; if (_current == null || now - _current.StartedAt >= _samplingDuration) { _current = new HealthCount { StartedAt = now }; } }
private void ActualiseCurrentMetric_NeedsLock() { long now = SystemClock.UtcNow().Ticks; if (_currentWindow == null || now - _currentWindow.StartedAt >= _windowDuration) { _currentWindow = new HealthCount { StartedAt = now }; _windows.Enqueue(_currentWindow); } while (_windows.Count > 0 && (now - _windows.Peek().StartedAt >= _samplingDuration)) _windows.Dequeue(); }
private void ActualiseCurrentMetric_NeedsLock() { long now = SystemClock.UtcNow().Ticks; if (_currentWindow == null || now - _currentWindow.StartedAt >= _windowDuration) { _currentWindow = new HealthCount { StartedAt = now }; _windows.Enqueue(_currentWindow); } while (_windows.Count > 0 && (now - _windows.Peek().StartedAt >= _samplingDuration)) { _windows.Dequeue(); } }
public void Reset_NeedsLock() { _currentWindow = null; _windows.Clear(); }
public void Reset_NeedsLock() { _current = null; }