2017-05-04 10:49:01 -07:00
|
|
|
const assert = require('assert')
|
|
|
|
|
2017-10-26 20:53:47 -04:00
|
|
|
describe('process module', () => {
|
|
|
|
describe('process.getCPUUsage()', () => {
|
|
|
|
it('returns a cpu usage object', () => {
|
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')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2017-10-26 20:53:47 -04:00
|
|
|
describe('process.getIOCounters()', () => {
|
2017-11-16 00:05:46 +03:00
|
|
|
before(function () {
|
|
|
|
if (process.platform === 'darwin') {
|
|
|
|
this.skip()
|
|
|
|
}
|
|
|
|
})
|
2017-10-26 20:53:47 -04:00
|
|
|
|
2017-11-16 00:05:46 +03:00
|
|
|
it('returns an io counters object', () => {
|
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
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|