mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Merge pull request #9214 from electron/app-memoryinfo
API to get memory of all processes of the app
This commit is contained in:
@@ -533,4 +533,17 @@ describe('app module', function () {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('getAppMemoryInfo() API', function () {
|
||||
it('returns the process memory of all running electron processes', function () {
|
||||
const appMemoryInfo = app.getAppMemoryInfo()
|
||||
assert.ok(appMemoryInfo.length > 0, 'App memory info object is not > 0')
|
||||
for (const {memory, pid} of appMemoryInfo) {
|
||||
assert.ok(memory.workingSetSize > 0, 'working set size is not > 0')
|
||||
assert.ok(memory.privateBytes > 0, 'private bytes is not > 0')
|
||||
assert.ok(memory.sharedBytes > 0, 'shared bytes is not > 0')
|
||||
assert.ok(pid > 0, 'pid is not > 0')
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user