private void TryUpdateGauge(string path, PerformanceCounterWrapper counter) { var value = counter.GetValue(_instanceName); if (value != null) { _statsd.Gauge(path, value); } }
private void TryUpdateCounter(string path, PerformanceCounterWrapper counter, ref long?lastValue) { var value = counter.GetValue(_instanceName); if (value == null) { return; } if (lastValue == null) { lastValue = value; return; } _statsd.Counter(path, value - lastValue); lastValue = value; }