diff --git a/src/Prometheus.jl b/src/Prometheus.jl index 21fff38..2efeef1 100644 --- a/src/Prometheus.jl +++ b/src/Prometheus.jl @@ -236,9 +236,6 @@ Increment the value of the gauge `g` with `v`. `v` defaults to `v = 1`. """ function inc(m::Gauge, v = 1.0) - if v < 0 - error("incrementing with negative value, use dec(...)?") - end @atomic m.value += v return nothing end @@ -250,9 +247,6 @@ Decrement the value of the gauge `g` with `v`. `v` defaults to `v = 1`. """ function dec(m::Gauge, v = 1.0) - if v < 0 - error("decrementing with negative value, use inc(...)?") - end @atomic m.value -= v return nothing end diff --git a/test/runtests.jl b/test/runtests.jl index bd5cbe8..c14f7d4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -76,13 +76,11 @@ end @test c.value == 1 Prometheus.inc(c, 2) @test c.value == 3 - @test_throws ErrorException Prometheus.inc(c, -1) # Prometheus.dec(...) Prometheus.dec(c) @test c.value == 2 Prometheus.dec(c, 1) @test c.value == 1 - @test_throws ErrorException Prometheus.dec(c, -1) # Prometheus.set_to_current_time(...) t0 = time() sleep(0.1)