2017-05-04 10:49:01 -07:00
|
|
|
const assert = require('assert')
|
|
|
|
|
|
|
|
describe('process module', function () {
|
|
|
|
describe('process.getCPUUsage()', function () {
|
|
|
|
it('returns a cpu usage object', function () {
|
2017-05-04 14:15:27 -07:00
|
|
|
const cpuUsage = process.getCPUUsage()
|
2017-05-04 10:49:01 -07:00
|
|
|
assert.equal(typeof cpuUsage.percentCPUUsage, 'number')
|
|
|
|
assert.equal(typeof cpuUsage.idleWakeupsPerSecond, 'number')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('process.getIOCounters()', function () {
|
|
|
|
it('returns an io counters object', function () {
|
2017-05-04 14:50:06 -07:00
|
|
|
if (process.platform === 'darwin') {
|
2017-05-04 12:27:47 -07:00
|
|
|
return
|
2017-05-04 12:03:05 -07:00
|
|
|
}
|
2017-05-04 14:15:27 -07:00
|
|
|
const ioCounters = process.getIOCounters()
|
2017-05-04 11:10:57 -07: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 10:49:01 -07:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|