Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #406 +/- ##
==========================================
- Coverage 91.87% 91.70% -0.18%
==========================================
Files 15 15
Lines 1120 1133 +13
Branches 139 141 +2
==========================================
+ Hits 1029 1039 +10
- Misses 69 71 +2
- Partials 22 23 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add `files_size` to `VALUE_TRANSFORMATION_MAP` with `{value!S}` (humanized size)
- Add `COMPUTED_FIELDS` list to distinguish computed fields from JSON schema fields
- Add `compute_files_size()` function that sums sizes of all session files via glob
- Compute `files_size` in `load_duct_runs` after loading each run
- Add `files_size` to default `--fields` in `_create_ls_parser`
- Update `test_schema.py` to exclude computed fields from schema equality check
- Add tests for `compute_files_size`, `load_duct_runs`, and `ls` output
Agent-Logs-Url: https://github.com/con/duct/sessions/829c6010-40e6-416a-99be-6f9361c06057
Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
Agent-Logs-Url: https://github.com/con/duct/sessions/829c6010-40e6-416a-99be-6f9361c06057 Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
files_size to con-duct ls output
src/con_duct/ls.py
Outdated
| if path.is_file(): | ||
| try: | ||
| total += path.stat().st_size | ||
| except OSError: |
There was a problem hiding this comment.
warrants at least logging for debug
There was a problem hiding this comment.
@copilot add logging ... since unexpected, I think it could even be WARNING
There was a problem hiding this comment.
Added lgr.debug("Could not get size of %s: %s", path_str, e) in the except OSError block in ca997ba.
There was a problem hiding this comment.
Upgraded to lgr.warning(...) in c19eaf9.
test/test_ls.py
Outdated
| result = self._run_ls(["file1_info.json"], "summaries", args) | ||
| assert "Files Size:" in result | ||
| # Should show humanized size (Bytes or kB etc.) not raw integer | ||
| assert any(unit in result for unit in ["Byte", "kB", "MB", "GB"]) |
There was a problem hiding this comment.
I think some of those tests warrant just addition of testing within existing tests instead of breeding their own -- I bet we do not have a test per each column. @copilot please review and adjust to retain coverage and testing but reduce code added in the tests
There was a problem hiding this comment.
Consolidated in ca997ba:
- Merged the empty-prefix case into
test_compute_files_size_sums_all_filesas a second assertion - Removed
test_load_duct_runs_includes_files_size— addedassert "files_size" in result[0]totest_load_duct_runs_sanityinstead - Removed
test_ls_files_size_in_outputandtest_ls_files_size_humanized_in_summaries— addedfiles_sizeto the_run_lshelper's default fields, then added the assertions totest_ls_sanity(humanized check) andtest_ls_json_output(field presence check)
…to existing tests Agent-Logs-Url: https://github.com/con/duct/sessions/74a1b4cf-2d72-4835-af90-44d1e11414f3 Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
Agent-Logs-Url: https://github.com/con/duct/sessions/3a36c202-bdc1-4d54-8469-0e8c2c988d2f Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
Users accumulating large log directories had no quick way to correlate session file sizes with other execution metrics like duration and memory usage.
Changes
files_sizefield: Computed at query time by globbing all files matching the session prefix and summing their sizes. Not stored in the info JSON — computed on the fly inload_duct_runs.!Sconversion ("{value!S}"), so it renders as e.g.4.2 MBinsummaries/pyoutoutput and as raw bytes injson/json_pp/yaml.--fieldslist so it shows up without any extra flags.COMPUTED_FIELDSlist: Distinguishes fields computed at query time from those present in the info JSON schema, allowing the schema conformance test to exclude them.Example