irmin icon indicating copy to clipboard operation
irmin copied to clipboard

(WIP) Gc stats

Open Ngoguey42 opened this issue 3 years ago • 3 comments

Ngoguey42 avatar Sep 16 '22 14:09 Ngoguey42

Codecov Report

Merging #2089 (01c43cb) into main (4ab886c) will decrease coverage by 0.19%. The diff coverage is 51.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

codecov-commenter avatar Sep 19 '22 10:09 codecov-commenter

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?

Ngoguey42 avatar Sep 22 '22 09:09 Ngoguey42

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:

metanivek avatar Sep 22 '22 18:09 metanivek

This is now ready for review.

Ngoguey42 avatar Sep 27 '22 13:09 Ngoguey42

I'm done with this PR. I'll clean the commit history prior to merge, following approves

Ngoguey42 avatar Oct 05 '22 14:10 Ngoguey42