package prom
Types and pretty printer for Prometheus text-based exposition format
Install
Dune Dependency
Authors
Maintainers
Sources
prom-0.3.tbz
sha256=ab2790fed9bf4cd5e8410a498cf92538975c7cb86959db560138296791579b2b
sha512=d28689793eb7d146a854d7d1cb692ffcadd6f8170f05b6f8c6ee7b14250d999ffa186f55b20f78eb01df26471f7cd7961566ee685f4a6be40d666e73fae3df9a
doc/src/prom.cfg/prom_cfg.ml.html
Source file prom_cfg.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
type ezjsonm = [ `O of (string * ezjsonm) list | `A of ezjsonm list | `Bool of bool | `Float of float | `String of string | `Null ] type yojson = [ `Bool of bool | `Assoc of (string * yojson) list | `Float of float | `Int of int | `Intlit of string | `List of yojson list | `Null | `String of string | `Tuple of yojson list | `Variant of string * yojson option ] module File_sd_config = struct type t = { targets : host list; labels : (string * string) list } and host = string * int option let string_of_host = function | host, None -> host | host, Some port -> host ^ ":" ^ string_of_int port let create ?(labels = []) targets = { targets; labels } let to_yojson cfgs = let to_yojson { targets; labels } = `Assoc [ ( "targets", `List (List.map (fun host -> `String (string_of_host host)) targets) ); ("labels", `Assoc (List.map (fun (k, v) -> (k, `String v)) labels)); ] in `List (List.map to_yojson cfgs) let to_ezjsonm cfgs = let to_yojson { targets; labels } = `O [ ( "targets", `A (List.map (fun host -> `String (string_of_host host)) targets) ); ("labels", `O (List.map (fun (k, v) -> (k, `String v)) labels)); ] in `A (List.map to_yojson cfgs) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>