forked from FoundKeyGang/FoundKey
refactor: fix type
This commit is contained in:
parent
510de87607
commit
645cf109e9
1 changed files with 4 additions and 4 deletions
|
@ -36,8 +36,8 @@ export default function() {
|
||||||
tx: round(Math.max(0, netStats.tx_sec)),
|
tx: round(Math.max(0, netStats.tx_sec)),
|
||||||
},
|
},
|
||||||
fs: {
|
fs: {
|
||||||
r: round(Math.max(0, fsStats.rIO_sec)),
|
r: round(Math.max(0, fsStats.rIO_sec ?? 0)),
|
||||||
w: round(Math.max(0, fsStats.wIO_sec)),
|
w: round(Math.max(0, fsStats.wIO_sec ?? 0)),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
ev.emit('serverStats', stats);
|
ev.emit('serverStats', stats);
|
||||||
|
@ -51,9 +51,9 @@ export default function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CPU STAT
|
// CPU STAT
|
||||||
function cpuUsage() {
|
function cpuUsage(): Promise<number> {
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
osUtils.cpuUsage((cpuUsage: number) => {
|
osUtils.cpuUsage((cpuUsage) => {
|
||||||
res(cpuUsage);
|
res(cpuUsage);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue