Skip to content

Commit

Permalink
Tezt/Cloud/process exporter: reuse init
Browse files Browse the repository at this point in the history
  • Loading branch information
baugr authored and Marge Bot committed Feb 28, 2025
1 parent ad17448 commit 4ca549e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tezt/lib_cloud/process_monitor.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ type t = {

let executable = "prometheus-process-exporter"

let init ~listening_port =
{listening_port; monitored_processes = []; checked_in_path = false}

let encoding =
let open Data_encoding in
conv
(fun {listening_port; monitored_processes = _; _} -> listening_port)
(fun listening_port ->
{listening_port; monitored_processes = []; checked_in_path = false})
(fun {listening_port; _} -> listening_port)
(fun listening_port -> init ~listening_port)
(obj1 (req "listening_port" int31))

let init ~listening_port =
{listening_port; monitored_processes = []; checked_in_path = false}

let add_binary t ~group ~name =
if List.mem (group, name) t.monitored_processes then false
else (
Expand Down

0 comments on commit 4ca549e

Please sign in to comment.