Skip to content

Commit

Permalink
Prevent wmic usage from pidusage
Browse files Browse the repository at this point in the history
We don't need the monitoring for our purposes and it uses a lot of CPU.
  • Loading branch information
BasvRossem authored Jan 27, 2025
1 parent 45fd8a3 commit d19348f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 116 deletions.
23 changes: 0 additions & 23 deletions test/e2e/misc/misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,6 @@ $pm2 stop push.json

$pm2 list

#
# Max memory auto restart option
#
# --max-memory-restart option && maxMemoryRestart (via JSON file)
#
$pm2 kill
PM2_WORKER_INTERVAL=1000 $pm2 start big-array.js --max-memory-restart="20M"
sleep 3
$pm2 list
should 'process should have been restarted' 'restart_time: 0' 0

$pm2 delete all

#
# Via JSON
#
$pm2 start json-reload/max-mem.json
sleep 3
$pm2 list
should 'process should been restarted' 'restart_time: 0' 0

$pm2 delete all

$pm2 start env.js

OUT_LOG=`$pm2 prettylist | grep -m 1 -E "pm_out_log_path:" | sed "s/.*'\([^']*\)',/\1/"`
Expand Down
7 changes: 4 additions & 3 deletions test/programmatic/god.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ describe('God', function() {
});
});

it('should get monitor data', function(done) {
it('should get empty monitor data', function(done) {
var f = require('child_process').fork('../fixtures/echo.js')

var processes = [
Expand Down Expand Up @@ -295,10 +295,11 @@ describe('God', function() {
g.getMonitorData({}, function(err, procs) {
should(err).be.null();
procs.length.should.be.equal(processes.length);
// Monitoring memory and CPU no longer works
procs[0].monit.should.be.deepEqual({memory: 0, cpu: 0});
procs[1].monit.memory.should.be.greaterThan(0);
procs[1].monit.should.be.deepEqual({memory: 0, cpu: 0});
procs[2].monit.should.be.deepEqual({memory: 0, cpu: 0});
procs[3].monit.memory.should.be.greaterThan(0);
procs[3].monit.should.be.deepEqual({memory: 0, cpu: 0});
f.kill()
done()
})
Expand Down
89 changes: 0 additions & 89 deletions test/programmatic/max_memory_limit.js

This file was deleted.

1 change: 0 additions & 1 deletion test/unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ runUnitTest $D/api.backward.compatibility.mocha.js
runUnitTest $D/custom_action.mocha.js
runUnitTest $D/logs.js
runUnitTest $D/watcher.js
runUnitTest $D/max_memory_limit.js
runUnitTest $D/cluster.mocha.js
runUnitTest $D/graceful.mocha.js
runUnitTest $D/inside.mocha.js
Expand Down

0 comments on commit d19348f

Please sign in to comment.