cse47122
4 years ago
1 changed files with 0 additions and 17 deletions
@ -1,17 +0,0 @@ |
|||
const ProgressBar = require('progress') |
|||
|
|||
module.exports = function stats (deviceManager) { |
|||
const bar = new ProgressBar('Time :elapsed: | Devices :devices | Measurements :measurements | Writes :writes | Size :size kb | Errors :errors', {total: 1000000}) |
|||
|
|||
const update = stats => { |
|||
stats = JSON.parse(JSON.stringify(stats)) |
|||
stats.size = Math.round((stats.size / 1024).toFixed(2)) |
|||
bar.tick(stats) |
|||
} |
|||
|
|||
setInterval(() => { |
|||
update(deviceManager.getStats()) |
|||
}, 100) |
|||
|
|||
return update |
|||
} |
Loading…
Reference in new issue