25 lines
518 B
JavaScript
25 lines
518 B
JavaScript
|
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
|