This commit is contained in:
syuilo
2018-06-18 09:54:53 +09:00
parent a766faeae9
commit 80e5645a84
150 changed files with 305 additions and 2334 deletions

View File

@@ -11,14 +11,14 @@ const interval = 1000;
* Report server stats regularly
*/
export default function() {
const log = [];
const log: any[] = [];
ev.on('requestServerStatsLog', id => {
ev.emit('serverStatsLog:' + id, log);
});
async function tick() {
osUtils.cpuUsage(cpuUsage => {
osUtils.cpuUsage((cpuUsage: number) => {
const disk = diskusage.checkSync(os.platform() == 'win32' ? 'c:' : '/');
const stats = {
cpu_usage: cpuUsage,