2017-05-04 20:49:01 +03:00
|
|
|
const assert = require('assert')
|
|
|
|
|
|
|
|
describe('process module', function () {
|
|
|
|
describe('process.getCPUUsage()', function () {
|
|
|
|
it('returns a cpu usage object', function () {
|
|
|
|
var cpuUsage = process.getCPUUsage()
|
|
|
|
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 22:03:05 +03:00
|
|
|
if (process.platform !== 'win32') {
|
2017-05-04 22:27:47 +03:00
|
|
|
return
|
2017-05-04 22:03:05 +03:00
|
|
|
}
|
2017-05-04 20:49:01 +03:00
|
|
|
var 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
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|