/// <inheritdoc /> public TimerValue GetValue(bool resetMetric = false) { var total = resetMetric ? _totalRecordedTime.GetAndReset() : _totalRecordedTime.GetValue(); return(new TimerValue(_meter.GetValue(resetMetric), _histogram.GetValue(resetMetric), _activeSessionsCounter.GetValue(), total, TimeUnit.Nanoseconds)); }
private CounterValue GetValueWithSetItems() { Debug.Assert(_setCounters != null, "set counters not null"); var total = _counter.GetValue(); var items = new CounterValue.SetItem[_setCounters.Count]; var index = 0; foreach (var item in _setCounters) { var itemValue = item.Value.GetValue(); double percent = total > 0 ? itemValue / (double)total * 100 : 0.0; var setCounter = new CounterValue.SetItem(item.Key, itemValue, percent); items[index++] = setCounter; if (index == items.Length) { break; } } Array.Sort(items, CounterValue.SetItemComparer); return(new CounterValue(total, items)); }
/// <inheritdoc /> public TimerValue GetValue(bool resetMetric = false) { return(new TimerValue( _meter.GetValue(resetMetric), _histogram.GetValue(resetMetric), _activeSessionsCounter.GetValue(), TimeUnit.Nanoseconds)); }
/// <inheritdoc /> public BucketTimerValue GetValue(bool resetMetric = false) { return(new BucketTimerValue( _meter.GetValue(resetMetric), _histogram.GetValue(resetMetric), _activeSessionsCounter.GetValue(), _timeUnit)); }
/// <inheritdoc /> public TimerValue GetValue(bool resetMetric = false) { var activeSessions = resetMetric ? _activeSessionsCounter.GetAndReset() : _activeSessionsCounter.GetValue(); return(new TimerValue( _meter.GetValue(resetMetric), _histogram.GetValue(resetMetric), activeSessions, TimeUnit.Nanoseconds)); }
public void Get() { // ReSharper disable UnusedVariable var x = _num.GetValue(); // ReSharper restore UnusedVariable }
/// <inheritdoc /> public MeterValue GetValue(double elapsed) { var count = _total.GetValue() + _uncounted.GetValue(); return(new MeterValue(count, GetMeanRate(count, elapsed), OneMinuteRate, FiveMinuteRate, FifteenMinuteRate, TimeUnit.Seconds)); }
public void Can_add_value() { _num.Add(7L); _num.GetValue().Should().Be(7L); }
internal bool IsUsed() { return(usageCounter.GetValue() > 0); }
public override long getTotalCount() { return(totalCount.GetValue()); }
public void Get() { var x = _num.GetValue(); }