(WIP) Gc stats
Codecov Report
Merging #2089 (01c43cb) into main (4ab886c) will decrease coverage by
0.19%. The diff coverage is51.55%.
@@ Coverage Diff @@
## main #2089 +/- ##
==========================================
- Coverage 64.69% 64.49% -0.20%
==========================================
Files 132 131 -1
Lines 15719 15828 +109
==========================================
+ Hits 10169 10208 +39
- Misses 5550 5620 +70
| Impacted Files | Coverage Δ | |
|---|---|---|
| bench/irmin-pack/trace_replay.ml | 41.46% <0.00%> (-0.17%) |
:arrow_down: |
| src/irmin-pack/unix/ext.ml | 61.78% <ø> (+0.09%) |
:arrow_up: |
| src/irmin-pack/unix/stats.ml | 50.58% <21.05%> (-7.63%) |
:arrow_down: |
| src/irmin-pack/unix/gc.ml | 39.22% <38.33%> (-5.67%) |
:arrow_down: |
| src/irmin-pack/unix/dispatcher.ml | 52.80% <41.66%> (+1.21%) |
:arrow_up: |
| src/irmin-pack/unix/control_file.ml | 86.48% <66.66%> (+1.12%) |
:arrow_up: |
| src/irmin-pack/unix/io.ml | 65.76% <70.58%> (+0.87%) |
:arrow_up: |
| src/irmin-pack/unix/mapping_file.ml | 93.75% <80.00%> (-0.50%) |
:arrow_down: |
| src/irmin-pack/unix/append_only_file.ml | 85.00% <85.71%> (ø) |
|
| src/irmin-pack/unix/stats_intf.ml | 85.00% <91.66%> (+35.00%) |
:arrow_up: |
| ... and 10 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
gc.ml is about 900 lines of code. I'd like to split it into Gc_utils (which would contain the new stats), Gc_worker and Gc at some point (not in this PR, after this PR is merged). @metanivek you did not fancy that solution last time we talked about this. WDYT now?
I usually think that "utils" are a code smell. Sometimes they are warranted as a collection of utility functions, but I usually want to pause and think about what I'm actually trying to model by stuffing things into a "utils". I don't know if this translates well, but I see them as the junk drawer of code bases. :wastebasket:
As for gc specifically, I shied away from it previously because of the above utils issue, but also I didn't see a strong need to pull apart the module since it all works as one unit anyway (the almost identical Args module indicating this strongly to me). I'm also noticing that lots of OCaml code bases have large module files (sometimes in the thousands of lines), and I wonder if it is just more common to place more code into files with OCaml than other languages.
All that to say, I wouldn't be opposed to splitting the file, but I would just like to see a better modelling than a utils file. :wink:
This is now ready for review.
I'm done with this PR. I'll clean the commit history prior to merge, following approves