con / duct

A helper to run a command, capture stdout/stderr and details about running
MIT License
1 stars 1 forks source link

At the end report absolute peak memory (may be with % if really like it) #49

Closed yarikoptic closed 3 weeks ago

yarikoptic commented 3 weeks ago

ATM I see

❯ duct -- ./test_script.py --duration 3 --memory-size=1000
duct is executing ./test_script.py --duration 3 --memory-size=1000...
Log files will be written to .duct/logs/2024.06.06T23.20.47-1211148_
this is of test of STDERR
this is of test of STDOUT
Test completed. Consumed 1000 MB for 3 seconds with CPU load factor 10000.

Exit Code: 0
Command: ./test_script.py --duration 3 --memory-size=1000
Log files location: .duct/logs/2024.06.06T23.20.47-1211148_
Wall Clock Time: 3.3275320529937744
Memory Peak Usage: 0.0%
CPU Peak Usage: 104.0%
duct -- ./test_script.py --duration 3 --memory-size=1000  4.18s user 2.58s system 197% cpu 3.428 total

which is odd -- not sure what 0.0% it is reporting given that 1GB was requested.

asmacdo commented 3 weeks ago

I'm happy to switch to absolute amount rather than %, I only used % because thats what smon does https://github.com/brainlife/abcd-spec/blob/master/hooks/smon#L151

asmacdo commented 3 weeks ago

Fixed by https://github.com/con/duct/pull/54

asmacdo commented 3 weeks ago
duct ./test_script.py --duration 3 --memory-size=1000 
duct is executing ./test_script.py --duration 3 --memory-size=1000...
Log files will be written to .duct/logs/2024.06.07T11.21.48-553879_
this is of test of STDERR
this is of test of STDOUT
Test completed. Consumed 1000 MB for 3 seconds with CPU load factor 10000.

Exit Code: 0
Command: ./test_script.py --duration 3 --memory-size=1000
Log files location: .duct/logs/2024.06.07T11.21.48-553879_
Wall Clock Time: 3.376 sec
Memory Peak Usage: 3.1%
CPU Peak Usage: 193.0%