-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove units for machine readability #125
Conversation
con#116 Note: I put KiB into the field names of the execution summary, because `ps` uses KiB, this seemed cleaner than modifying the values into bytes. ``` $ duct -p ZZZZ_ --r-i 0.1 --s-i 0.01 --clobber sleep 1 duct is executing sleep 1... Log files will be written to ZZZZ_ Exit Code: 0 Command: sleep 1 Log files location: ZZZZ_ Wall Clock Time: 1.001 sec Memory Peak Usage (RSS) KiB: 1600 Memory Average Usage (RSS) KiB: 1561.905 Virtual Memory Peak Usage (VSZ) KiB: 221584 Virtual Memory Average Usage (VSZ) KiB: 216308.190 Memory Peak Percentage: 0.0% Memory Average Percentage: 0.000 CPU Peak Usage: 0.0 Average CPU Usage: 0.000 Samples Collected: 42 Reports Written: 11 $ cat ZZZZ_info.json|jq { "command": "sleep 1", "system": { "uid": "austin", "memory_total": 33336778752, "cpu_total": 20 }, "env": {}, "gpu": null, "duct_version": "0.1.1", "execution_summary": { "exit_code": 0, "command": "sleep 1", "logs_prefix": "ZZZZ_", "wall_clock_time": "1.001", "peak_rss_kib": "1760", "average_rss_kib": "1760.000", "peak_vsz_kib": "221584", "average_vsz_kib": "221584.000", "peak_pmem": "0.0%", "average_pmem": "0.000", "peak_pcpu": "0.0", "average_pcpu": "0.000", "num_samples": 41, "num_reports": 10 } } ```
=== Do not change lines below === { "chain": [], "cmd": "./.update-readme-help.py", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
==========================================
+ Coverage 93.60% 93.76% +0.16%
==========================================
Files 2 2
Lines 344 353 +9
Branches 56 57 +1
==========================================
+ Hits 322 331 +9
Misses 16 16
Partials 6 6 ☔ View full report in Codecov by Sentry. |
@yarikoptic it kinda bothers me that "memory_total" is bytes, but the samples are KiB, but its fine. WDYT |
$ duct -p ZZZZ_ --r-i 0.1 --s-i 0.01 --clobber sleep 1 duct is executing sleep 1... Log files will be written to ZZZZ_ Exit Code: 0 Command: sleep 1 Log files location: ZZZZ_ Wall Clock Time: 1.006 sec Memory Peak Usage (RSS): 1802240 Memory Average Usage (RSS): 1758282 Virtual Memory Peak Usage (VSZ): 226902016 Virtual Memory Average Usage (VSZ): 221367820 Memory Peak Percentage: 0.0 Memory Average Percentage: 0.000 CPU Peak Usage: 0.0 Average CPU Usage: 0.000 Samples Collected: 41 Reports Written: 11 $ cat ZZZZ_info.json| jq { "command": "sleep 1", "system": { "uid": "austin", "memory_total": 33336778752, "cpu_total": 20 }, "env": {}, "gpu": null, "duct_version": "0.1.1", "execution_summary": { "exit_code": 0, "command": "sleep 1", "logs_prefix": "ZZZZ_", "wall_clock_time": "1.006", "peak_rss": "1802240", "average_rss": "1758282", "peak_vsz": "226902016", "average_vsz": "221367820", "peak_pmem": "0.0", "average_pmem": "0.000", "peak_pcpu": "0.0", "average_pcpu": "0.000", "num_samples": 41, "num_reports": 11 } }
=== Do not change lines below === { "chain": [], "cmd": "./.update-readme-help.py", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
Didn't forget to add a test |
@yarikoptic I'm not sure what kind of test you had in mind, since there are other places earlier in the code that would go wrong if those values weren't numbers. I figured it would be best to just add some more assertions into the runtime, and add validation where we first get the values from lmk if this isn't what you had in mind. |
@yarikoptic done pushing ready for re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left individual comments, please reduce code duplication and possibly return original numerics in the record?
This is intended to be machine readable, better to keep the values as they are without rounding or truncation.
=== Do not change lines below === { "chain": [], "cmd": "./.update-readme-help.py", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
Accidentally left out of new venv
0375f45
to
774227c
Compare
=== Do not change lines below === { "chain": [], "cmd": "./.update-readme-help.py", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
Removed check for timestamp being a string, and relax requirement for int rather than float for some fields. This significantly reduces complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor recommendation on clearer variable naming and one reference for that "default" (now is also a separate issue so could be done separately).
@@ -158,6 +169,9 @@ class Averages: | |||
num_samples: int = 0 | |||
|
|||
def update(self: Averages, other: Sample) -> None: | |||
assert_num( | |||
other.total_rss, other.total_vsz, other.total_pmem, other.total_pcpu | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this smells like location to add a single if statement and go to assignment upon not num_samples
and otherwise use +=
and then have defaults to None
above to the averages which we simply don't know upon the moment of this class instance initiation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to address this in the next one, dropping the release tag here, will add over there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #116
Fixes #128
Note: I put KiB into the field names of the execution summary, because
ps
uses KiB, this seemed cleaner than modifying the values into bytes.