Skip to content

Commit

Permalink
Merge pull request #14667 from MinaProtocol/add-timing-logs-to-check-…
Browse files Browse the repository at this point in the history
…database

add timing log to `check_database`
  • Loading branch information
mrmr1993 authored Jan 10, 2024
2 parents 1f58bfb + c0a7aec commit bb41ad3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib/transition_frontier/transition_frontier.ml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ let load_from_persistence_and_start ~context:(module Context : CONTEXT)
(Precomputed_values.genesis_state_hashes precomputed_values).state_hash
}

let time ~logger ~label f =
let start = Time.now () in
let x = f () in
let stop = Time.now () in
[%log info] "%s took %s" label
(Time.Span.to_string_hum (Time.diff stop start)) ;
x

let rec load_with_max_length :
context:(module CONTEXT)
-> max_length:int
Expand Down Expand Up @@ -283,6 +291,8 @@ let rec load_with_max_length :
~snarked_ledger_hash:genesis_ledger_hash
in
match
time ~label:"Persistent_frontier.Instsance.check_database" ~logger
@@ fun () ->
Persistent_frontier.Instance.check_database
~genesis_state_hash:
(State_hash.With_state_hashes.state_hash
Expand Down

0 comments on commit bb41ad3

Please sign in to comment.