Add startTimer to Gauge

Add startTimer interface to Gauge similar to how the startTimer
interface for Histogram works.
This commit is contained in:
Hornwitser committed 2020-11-30 02:49:06 +01:00
1 parent 49b5b4412f
commit 69221a310c
2 files changed
+37

No files matched your search

+10
View File
@@ -198,6 +198,16 @@ describe("lib/prometheus", function() {
);
});
});
describe(".startTimer()", function() {
it("should set the gauge to a short duration", function() {
let setDuration = gauge.startTimer();
setDuration();
assert(
gauge._values.get("") > 0 && gauge._values.get("") < 1,
"value set is not between 0 and 1"
);
});
});
});
describe("class Histogram", function() {