@lodestar/beacon-node
Version:
A Typescript implementation of the beacon chain
19 lines • 474 B
JavaScript
import { Gauge } from "prom-client";
/**
* Extends the prom-client Gauge to be able to add multiple collect functions after instantiation
*/
export class GaugeExtra extends Gauge {
collectFns = [];
addCollect(collectFn) {
this.collectFns.push(collectFn);
}
/**
* @override Metric.collect
*/
collect() {
for (const collectFn of this.collectFns) {
collectFn(this);
}
}
}
//# sourceMappingURL=gauge.js.map