public void Decrement()
        {
            noLabel.Decrement();
            Assert.Equal(-1, noLabel.Value());

            noLabel.Decrement(2);
            Assert.Equal(-3, noLabel.Value());

            noLabel.WithLabels().Decrement(4);
            Assert.Equal(-7, noLabel.Value());

            noLabel.WithLabels().Decrement();
            Assert.Equal(-8, noLabel.Value());
        }
        public static T TrackInProgress <T>(this IGauge gauge, Func <T> fun)
        {
            gauge.Increment();
            var ret = fun.Invoke();

            gauge.Decrement();

            return(ret);
        }
 public static void TrackInProgress(this IGauge gauge, Action fun)
 {
     gauge.Increment();
     fun.Invoke();
     gauge.Decrement();
 }
Exemple #4
0
 /// <inheritdoc />
 public void Dispose()
 {
     _gauge.Decrement();
 }