package octez-internal-libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Irmin_pack_unix.StatsSource

Sourcemodule Pack_store : sig ... end
Sourcemodule Index : sig ... end
Sourcemodule File_manager : sig ... end
Sourcemodule Latest_gc : sig ... end
Sourcetype t = {
  1. pack_store : Pack_store.stat;
  2. index : Index.stat;
  3. file_manager : File_manager.stat;
  4. latest_gc : Latest_gc.stat;
}

Record type for all statistics that will be collected. There is a single instance (which we refer to as "the instance" below) which is returned by get.

Sourceval reset_stats : unit -> unit

reset_stats () will call the relevant clear function on each field of the instance. This typically resets the fields (e.g. to 0 for an int field).

Sourceval get : unit -> t

get () returns the instance of t that stores the satistics. If report_pack_store or report_index is not called before, the content will be filled with default value, decided at create time (most the time, 0).

Sourceval report_pack_store : field:Pack_store.field -> unit

report_pack_store ~field increments the field value in the pack_store stats. It also increments the total field in Pack_store.t when the field is related to finds.

Sourceval report_index : unit -> unit

report_index () fills the stats with value from the Index.Stats module. This essentially copies the "current" values from Index.Stats to the get() instance index field.

Sourceval incr_appended_hashes : unit -> unit

incr_appended_hashes () increments the field appended_hashes for pack_store in the instance.

Sourceval incr_appended_offsets : unit -> unit

incr_appended_offsets increments the field appended_offsets for pack_store in the instance.

Sourcetype cache_stats = {
  1. cache_misses : float;
}
Sourcetype offset_stats = {
  1. offset_ratio : float;
  2. offset_significance : int;
}

offset_ratio: appended_offsets / (appended_offsets + appended_hashes); offset_significance: appended_offsets + appended_hashes

Sourceval get_cache_stats : unit -> cache_stats

get_cache_stats() uses the instance pack_store field to compute cache misses.

Sourceval get_offset_stats : unit -> offset_stats

get_offset_stats() uses the instance pack_store field to compute offset stats.

Sourceval incr_fm_field : File_manager.field -> unit

incr_fm_field field increments the chosen stats field for the File_manager

Sourceval report_latest_gc : Latest_gc.stats -> unit

report_latest_gc gc_stats sets (get ()).latest_gc to the stats of the latest successful GC.

OCaml

Innovation. Community. Security.