UNPKG

process-stats

Version:

Display dynamic real-time information about running Node.js process

16 lines (12 loc) 337 B
'use strict' const os = require('os') const util = require('./util') module.exports = top => { const { getCpuUsage, getMs, getMemStats } = util(top) return { cpu: getCpuUsage(), uptime: getMs(process.uptime() * 1000), memUsed: getMemStats(process.memoryUsage.rss(), os.totalmem()), delay: getMs(top.delay()) } }