feat: add cumulativeCPUUsage to AppMetrics and CPUUsage (#41819)
This allows apps to measure their CPU usage over any given period without worrying about other calls affecting the output, as they would with `percentCPUUsage`.
This commit is contained in:
parent
f35a755086
commit
d8e4579e3c
5 changed files with 25 additions and 6 deletions
|
@ -26,6 +26,7 @@ describe('process module', () => {
|
|||
it('returns a cpu usage object', async () => {
|
||||
const cpuUsage = await w.webContents.executeJavaScript('process.getCPUUsage()');
|
||||
expect(cpuUsage.percentCPUUsage).to.be.a('number');
|
||||
expect(cpuUsage.cumulativeCPUUsage).to.be.a('number');
|
||||
expect(cpuUsage.idleWakeupsPerSecond).to.be.a('number');
|
||||
});
|
||||
});
|
||||
|
@ -124,6 +125,7 @@ describe('process module', () => {
|
|||
it('returns a cpu usage object', () => {
|
||||
const cpuUsage = process.getCPUUsage();
|
||||
expect(cpuUsage.percentCPUUsage).to.be.a('number');
|
||||
expect(cpuUsage.cumulativeCPUUsage).to.be.a('number');
|
||||
expect(cpuUsage.idleWakeupsPerSecond).to.be.a('number');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue