@@ -14,10 +14,10 @@ let default_missing_blocks_width = 2000
1414
1515module Max_block_height = struct
1616 let query =
17- Caqti_request. find Caqti_type. unit Caqti_type. int
17+ Mina_caqti. find_req Caqti_type. unit Caqti_type. int
1818 " SELECT GREATEST(0, MAX(height)) FROM blocks"
1919
20- let update (module Conn : Caqti_async .CONNECTION ) metric_server =
20+ let update (module Conn : Mina_caqti .CONNECTION ) metric_server =
2121 time ~label: " max_block_height" (fun () ->
2222 let open Deferred.Result.Let_syntax in
2323 let % map max_height = Conn. find query () in
3030module Missing_blocks = struct
3131 (* A block is missing if there is no entry for a specific height. However, if there is an entry then it doesn't necessarily mean that it is part of the main chain. Unparented_blocks will show value > 1 in that case. Look for the last 2000 blocks*)
3232 let query missing_blocks_width =
33- Caqti_request. find Caqti_type. unit Caqti_type. int
33+ Mina_caqti. find_req Caqti_type. unit Caqti_type. int
3434 (Core_kernel. sprintf
3535 {sql|
3636 SELECT COUNT ( * )
@@ -40,7 +40,7 @@ module Missing_blocks = struct
4040 | sql}
4141 missing_blocks_width )
4242
43- let update ~missing_blocks_width (module Conn : Caqti_async .CONNECTION )
43+ let update ~missing_blocks_width (module Conn : Mina_caqti .CONNECTION )
4444 metric_server =
4545 let open Deferred.Result.Let_syntax in
4646 time ~label: " missing_blocks" (fun () ->
@@ -55,13 +55,13 @@ module Unparented_blocks = struct
5555 (* parent_hashes represent ends of chains leading to an orphan block *)
5656
5757 let query =
58- Caqti_request. find Caqti_type. unit Caqti_type. int
58+ Mina_caqti. find_req Caqti_type. unit Caqti_type. int
5959 {sql|
6060 SELECT COUNT ( * ) FROM blocks
6161 WHERE parent_id IS NULL
6262 | sql}
6363
64- let update (module Conn : Caqti_async .CONNECTION ) metric_server =
64+ let update (module Conn : Mina_caqti .CONNECTION ) metric_server =
6565 let open Deferred.Result.Let_syntax in
6666 time ~label: " unparented_blocks" (fun () ->
6767 let % map unparented_block_count = Conn. find query () in
7373
7474let log_error ~logger pool metric_server
7575 (f :
76- (module Caqti_async .CONNECTION)
76+ (module Mina_caqti .CONNECTION)
7777 -> Mina_metrics.Archive.t
7878 -> (unit, [> Caqti_error.call_or_retrieve ]) Deferred.Result.t ) =
7979 let open Deferred.Let_syntax in
8080 match % map
81- Caqti_async .Pool. use
82- (fun (module Conn : Caqti_async .CONNECTION ) ->
81+ Mina_caqti .Pool. use
82+ (fun (module Conn : Mina_caqti .CONNECTION ) ->
8383 f (module Conn ) metric_server )
8484 pool
8585 with
0 commit comments