Module Stat_trace.V0

val version : int
type float32 = int32
val float32_t : int32 Repr.t
type pack = {
  1. finds : int;
  2. cache_misses : int;
  3. appended_hashes : int;
  4. appended_offsets : int;
}

Stats extracted from Irmin_pack.Stats.get ().

val pack_t : pack Repr.t
type tree = {
  1. contents_hash : int;
  2. contents_find : int;
  3. contents_add : int;
  4. node_hash : int;
  5. node_mem : int;
  6. node_add : int;
  7. node_find : int;
  8. node_val_v : int;
  9. node_val_find : int;
  10. node_val_list : int;
}

Stats extracted from Irmin.Tree.counters ().

val tree_t : tree Repr.t
type index = {
  1. bytes_read : int;
  2. nb_reads : int;
  3. bytes_written : int;
  4. nb_writes : int;
  5. nb_merge : int;
  6. new_merge_durations : float list;
}

Stats extracted from Index.Stats.get ().

new_merge_durations is not just a mirror of Index.Stats.merge_durations, it only contains the new entries since the last time it was recorded. This list is always empty when in the header.

val index_t : index Repr.t
type 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;
}

Stats extracted from Gc.quick_stat ().

val gc_t : gc Repr.t
type disk = {
  1. index_data : int64;
  2. index_log : int64;
  3. index_log_async : int64;
  4. store_dict : int64;
  5. store_pack : int64;
}

Stats extracted from filesystem. Requires the path to the irmin store.

val disk_t : disk Repr.t
type 'pack_stats bag_of_stats_base = {
  1. pack : 'pack_stats;
  2. tree : tree;
  3. index : index;
  4. gc : gc;
  5. disk : disk;
  6. timestamp_wall : float;
  7. timestamp_cpu : float;
}

Melting pot of stats, recorded before and after every commits.

They are necessary in order to compute any throughput analytics.

val bag_of_stats_base_t : 'a Repr.t -> 'b bag_of_stats_base Repr.t
type store_before = {
  1. nodes : int;
  2. leafs : int;
  3. skips : int;
  4. depth : int;
  5. width : int;
}

Stats computed from the tree value passed to the commit operation, before the commit, when the tree still carries the modifications brought by the previous operations.

val store_before_t : store_before Repr.t
type watched_node = [
  1. | `Contracts_index
  2. | `Big_maps_index
  3. | `Rolls_index
  4. | `Rolls_owner_current
  5. | `Commitments
  6. | `Contracts_index_ed25519
  7. | `Contracts_index_originated
]
val watched_node_t : [ `Big_maps_index | `Commitments | `Contracts_index | `Contracts_index_ed25519 | `Contracts_index_originated | `Rolls_index | `Rolls_owner_current ] Repr.t
val min_watched_node : int
val max_watched_node : int
val watched_node_to_enum : [< `Big_maps_index | `Commitments | `Contracts_index | `Contracts_index_ed25519 | `Contracts_index_originated | `Rolls_index | `Rolls_owner_current ] -> int
val watched_node_of_enum : int -> [> `Big_maps_index | `Commitments | `Contracts_index | `Contracts_index_ed25519 | `Contracts_index_originated | `Rolls_index | `Rolls_owner_current ] option
type store_after = {
  1. watched_nodes_length : int list;
}

Stats computed on the tree value passed to the commit operation, after the commit, when the inode has been reconstructed and that Tree.length is now innexpensive to perform.

val store_after_t : store_after Repr.t
type 'pack_stats commit_base = {
  1. duration : float32;
  2. before : 'pack_stats bag_of_stats_base;
  3. after : 'pack_stats bag_of_stats_base;
  4. store_before : store_before;
  5. store_after : store_after;
}
val commit_base_t : 'a Repr.t -> 'b commit_base Repr.t
type 'pack_stats row_base = [
  1. | `Add of float32
  2. | `Remove of float32
  3. | `Find of float32
  4. | `Mem of float32
  5. | `Mem_tree of float32
  6. | `Checkout of float32
  7. | `Copy of float32
  8. | `Commit of 'pack_stats commit_base
]
val row_base_t : 'a Repr.t -> [ `Add of int32 | `Checkout of int32 | `Commit of 'a commit_base | `Copy of int32 | `Find of int32 | `Mem of int32 | `Mem_tree of int32 | `Remove of int32 ] Repr.t
type row = pack row_base

Stats gathered while running an operation.

Operation durations

For each operation we record its wall time length using a float32, a float16 would be suitable too (it has >3 digits of precision).

Time and disk performance considerations

On commit we record a lot of things, thankfuly the frequency is low: ~1/600. 599 small operations weigh ~3600 bytes, 1 commit weighs ~300 bytes. The trace reaches 1GB after ~250k commits.

val row_t : [ `Add of int32 | `Checkout of int32 | `Commit of pack commit_base | `Copy of int32 | `Find of int32 | `Mem of int32 | `Mem_tree of int32 | `Remove of int32 ] Repr.t
type setup_play = unit

Informations gathered from the tezos node.

Noting so far. Any ideas?

val setup_play_t : unit Repr.t
type setup_replay = {
  1. path_conversion : [ `None | `V1 | `V0_and_v1 | `V0 ];
  2. artefacts_dir : string;
}

Informations gathered from the tree.exe parameters.

val setup_replay_t : setup_replay Repr.t
type config = {
  1. inode_config : int * int * int;
  2. store_type : [ `Pack | `Pack_layered | `Pack_mem ];
  3. setup : [ `Play of setup_play | `Replay of setup_replay ];
}
val config_t : config Repr.t
type 'pack_stats header_base = {
  1. config : config;
  2. hostname : string;
  3. timeofday : float;
  4. word_size : int;
  5. initial_stats : 'pack_stats bag_of_stats_base;
}
val header_base_t : 'a Repr.t -> 'b header_base Repr.t
type header = pack header_base

File header.

Timestamps

stats.timestamp_wall and stats.timestamp_cpu are the starting points of the trace, they are to be substracted from their counterpart in commit to compute time spans.

timeofday is the date and time at which the stats started to be accumulated.

stats.timestamp_wall may originate from Mtime_clock.now.

stats.timestamp_cpu may originate from Sys.time.

It would be great to be able to record the library/sources versions.

val header_t : pack header_base Repr.t
type commit = pack commit_base
val commit_t : pack commit_base Repr.t
type bag_of_stats = pack bag_of_stats_base
val bag_of_stats_t : pack bag_of_stats_base Repr.t