con / duct

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

Collect more stats #104

Closed asmacdo closed 1 week ago

asmacdo commented 1 week ago

Fixes: https://github.com/con/duct/issues/63 Fixes: https://github.com/con/duct/issues/41

$ duct --s-i 1 --r-i 2 -p ZZZZ_  --clobber ./test/data/test_script.py --duration 10 --memory-size 1000
duct is executing ./test/data/test_script.py --duration 10 --memory-size 1000...
Log files will be written to ZZZZ_
this is of test of STDERR
this is of test of STDOUT
Test completed. Consumed 1000 MB for 10 seconds with CPU load factor 10000.

Exit Code: 0
Command: ./test/data/test_script.py --duration 10 --memory-size 1000
Log files location: ZZZZ_
Wall Clock Time: 10.366 sec
Memory Peak Usage (RSS): 1036000 KiB
Memory Average Usage (RSS): 1036000.000 KiB
Virtual Memory Peak Usage (VSZ): 1258432 KiB
Virtual Memory Average Usage (VSZ): 1258432.000 KiB
Memory Peak Percentage: 3.1%
Memory Average Percentage: 3.100%
CPU Peak Usage: 100.0%
Average CPU Usage: 99.780%
Samples Collected: 10
Reports Written: 6
codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 98.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.90%. Comparing base (eb1237c) to head (97ea981). Report is 2 commits behind head on main.

Files Patch % Lines
src/duct/__main__.py 98.33% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #104 +/- ## ========================================== + Coverage 92.47% 93.90% +1.42% ========================================== Files 2 2 Lines 319 361 +42 Branches 50 55 +5 ========================================== + Hits 295 339 +44 + Misses 18 16 -2 Partials 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

asmacdo commented 1 week ago

The print statements have gotten to be quite messy, and this PR makes it worse, but I'll refactor that in https://github.com/con/duct/issues/64

asmacdo commented 1 week ago

@jwodder do you want another look are am I good to merge?