예제 #1
0
        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();
 }
예제 #4
0
 /// <inheritdoc />
 public void Dispose()
 {
     _gauge.Decrement();
 }