Implement metrics
This commit is contained in:
24
metrics/metricManager.js
Normal file
24
metrics/metricManager.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const cliProgress = require("cli-progress");
|
||||
const { Metric } = require("./metrics");
|
||||
|
||||
class MetricManager {
|
||||
constructor() {
|
||||
this.metricBufferSize = 1000;
|
||||
this.multibar = new cliProgress.MultiBar(
|
||||
{
|
||||
clearOnComplete: false,
|
||||
barCompleteChar: "\u2588",
|
||||
barIncompleteChar: "\u2591",
|
||||
format: " {bar} | {name} | {value}/{total}",
|
||||
},
|
||||
cliProgress.Presets.shades_grey
|
||||
);
|
||||
}
|
||||
|
||||
AddMetrics(name) {
|
||||
const metric = new Metric(name, this.multibar, this.metricBufferSize);
|
||||
return metric;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { MetricManager };
|
||||
Reference in New Issue
Block a user