Module Stats.Latest_gc

include module type of Stats_intf.Latest_gc with type duration = Stats_intf.Latest_gc.duration with type ocaml_gc = Stats_intf.Latest_gc.ocaml_gc with type rusage = Stats_intf.Latest_gc.rusage with type step = Stats_intf.Latest_gc.step with type worker = Stats_intf.Latest_gc.worker with type stats = Stats_intf.Latest_gc.stats with type t = Stats_intf.Latest_gc.t
type rusage = Stats_intf.Latest_gc.rusage = {
  1. maxrss : int64;
  2. minflt : int64;
  3. majflt : int64;
  4. inblock : int64;
  5. oublock : int64;
  6. nvcsw : int64;
  7. nivcsw : int64;
}
type ocaml_gc = Stats_intf.Latest_gc.ocaml_gc = {
  1. minor_words : float;
  2. promoted_words : float;
  3. major_words : float;
  4. minor_collections : int;
  5. major_collections : int;
  6. heap_words : int;
  7. compactions : int;
  8. top_heap_words : int;
  9. stack_size : int;
}
type duration = Stats_intf.Latest_gc.duration = {
  1. wall : float;
  2. sys : float;
  3. user : float;
}

Timings in seconds

Stats gathered for one worker step

type worker = Stats_intf.Latest_gc.worker = {
  1. initial_maxrss : int64;
  2. initial_heap_words : int;
  3. initial_top_heap_words : int;
  4. initial_stack_size : int;
  5. steps : (string * step) list;
  6. files : (string * Import.int63) list;
  7. objects_traversed : Import.int63;
  8. suffix_transfers : Import.int63 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.

type stats = Stats_intf.Latest_gc.stats = {
  1. generation : int;
  2. commit_offset : Import.int63;
  3. before_suffix_start_offset : Import.int63;
  4. before_suffix_end_offset : Import.int63;
  5. after_suffix_start_offset : Import.int63;
  6. after_suffix_end_offset : Import.int63;
  7. steps : (string * duration) list;
  8. worker : worker;
}

All the stats for a single successful GC run.

commit_offset is the offset of the commit provided by the brassaia 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.

Latest_gc.t is an option type because before the first gc end, there are no gc stats to expose.

type stat
val export : stat -> t
val new_suffix_end_offset_before_finalise : worker -> Import.int63
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 -> Import.int63

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.