2017-05-04 20:49:01 +03:00
|
|
|
const assert = require('assert')
|
|
|
|
|
2017-10-27 03:53:47 +03:00
|
|
|
describe('process module', () => {
|
|
|
|
describe('process.getCPUUsage()', () => {
|
|
|
|
it('returns a cpu usage object', () => {
|
2017-05-05 00:15:27 +03:00
|
|
|
const cpuUsage = process.getCPUUsage()
|
2017-05-04 20:49:01 +03:00
|
|
|
assert.equal(typeof cpuUsage.percentCPUUsage, 'number')
|
|
|
|
assert.equal(typeof cpuUsage.idleWakeupsPerSecond, 'number')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2017-10-27 03:53:47 +03:00
|
|
|
describe('process.getIOCounters()', () => {
|
|
|
|
it('returns an io counters object', () => {
|
|
|
|
if (process.platform === 'darwin') return
|
|
|
|
|
2017-05-05 00:15:27 +03:00
|
|
|
const ioCounters = process.getIOCounters()
|
2017-05-04 21:10:57 +03:00
|
|
|
assert.equal(typeof ioCounters.readOperationCount, 'number')
|
|
|
|
assert.equal(typeof ioCounters.writeOperationCount, 'number')
|
|
|
|
assert.equal(typeof ioCounters.otherOperationCount, 'number')
|
|
|
|
assert.equal(typeof ioCounters.readTransferCount, 'number')
|
|
|
|
assert.equal(typeof ioCounters.writeTransferCount, 'number')
|
|
|
|
assert.equal(typeof ioCounters.otherTransferCount, 'number')
|
2017-05-04 20:49:01 +03:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|