maestro/app/classes/logical/SystemMetrics.js

25 lines
518 B
JavaScript
Raw Normal View History

2020-02-21 06:36:55 +00:00
const { Injectable } = require('flitter-di')
class SystemMetrics extends Injectable {
_cpu = 0
_ram = 0
_mounts = {}
cpu(set = false) {
if ( set !== false ) this._cpu = set
else return this._cpu
}
ram(set = false) {
if ( set !== false ) this._ram = set
else return this._ram
}
mount(point, set = false) {
if ( set !== false ) this._mounts[point] = set
else return this._mounts[point]
}
}
module.exports = exports = SystemMetrics