Stats.Latest_gc
val rusage_t : rusage Irmin.Type.t
val ocaml_gc_t : ocaml_gc Irmin.Type.t
val duration_t : duration Irmin.Type.t
type step = {
duration : duration;
rusage : rusage;
ocaml_gc : ocaml_gc;
index : Irmin_pack_unix__.Stats_intf.Index.S.t;
pack_store : Irmin_pack_unix__.Stats_intf.Pack_store.t;
inode : Irmin_pack.Stats.Inode.t;
}
Stats gathered for one worker step
val step_t : step Irmin.Type.t
type worker = {
initial_maxrss : int64;
initial_heap_words : int;
initial_top_heap_words : int;
initial_stack_size : int;
steps : (string * step) list;
files : (string * Optint.Int63.t) list;
objects_traversed : Optint.Int63.t;
suffix_transfers : Optint.Int63.t list;
}
Stats produced by the worker. They are meant to be transmited to the parent process through the gc result JSON file.
steps
is the list of all step names associated with the timing of these steps plus stats recorded at the end of the step. An association lists is used here instead of types because in the future the exact list of tasks may change and we don't want the rigidity of types, especially because these informations will end up appearing in a file format.
Since the worker lives in a fork, rusage
and ocaml_gc
contain stats that are impacted by what happened in the main process, prior to the fork. The init_*
fields reflect this.
The total wall time of the worker is the sum of all wall
fields in steps
.
files
contains the size of files created by the GC. And association list is used instead of plain types for the same reason as steps
/
suffix_transfers
contains an int for each transfer loop to the new suffix. That integer corresponds to the number of bytes copied during that loop. The sum of these integers is equal to the "suffix" step in files
.
val worker_t : worker Irmin.Type.t
type stats = {
generation : int;
commit_offset : Optint.Int63.t;
before_suffix_start_offset : Optint.Int63.t;
before_suffix_end_offset : Optint.Int63.t;
after_suffix_start_offset : Optint.Int63.t;
after_suffix_end_offset : Optint.Int63.t;
steps : (string * duration) list;
worker : worker;
}
All the stats for a single successful GC run.
commit_offset
is the offset of the commit provided by the irmin user.
The before_*
(and after_*
) offsets track the state of the suffix before (and after) the GC.
steps
has a similar meaning as steps
in worker
but for the main process.
val stats_t : stats Irmin.Type.t
Latest_gc.t
is an option
type because before the first gc end, there are no gc stats to expose.
val t : stats option Irmin.Type.t
val new_suffix_end_offset_before_finalise : worker -> Optint.Int63.t
val finalise_duration : stats -> float
Time taken by the GC finalisation in seconds. It includes the time it took to wait for the worker to finish in case of ~wait:true
.
val total_duration : stats -> float
Total wall duration of the GC in seconds, from the call to GC and to the end of finalise. This duration contains the time it takes for the user to trigger a finalise while the worker is over.
val finalise_suffix_transfer : stats -> Optint.Int63.t
finalise_suffix_transfer stats
is the number of bytes appended to the new suffix by the finalise step of the GC. Before this, the worker already appended bytes to the new suffix, this is reported in worker.suffix_transfers
.