Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ocaml/opam:debian-11-ocaml-4.13@sha256:facb9f1272610683f75580a8189116dcc4f4fff6958640e81bf568ec8ffc6302 AS build
FROM ocaml/opam:debian-11-ocaml-4.14@sha256:b83fcce3b715fe10ee2d3060763379e1ad9be76832d67203652f2c0abd6ae50d AS build
RUN sudo apt-get update && sudo apt-get install libev-dev capnproto m4 pkg-config libsqlite3-dev libgmp-dev -y --no-install-recommends
RUN cd ~/opam-repository && git pull origin -q master && git reset --hard ae6aff50030492f9b7eed0cf952fdca40f4cf125 && opam update
RUN cd ~/opam-repository && git pull origin -q master && git reset --hard 11e634fd946c90fdb26c14ae5f7759e644c898f0 && opam update
COPY --chown=opam ocluster-api.opam ocluster.opam /src/
COPY --chown=opam obuilder/obuilder.opam obuilder/obuilder-spec.opam /src/obuilder/
RUN opam pin -yn /src/obuilder/
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ocaml/opam:debian-11-ocaml-4.13@sha256:fe25836078456e1691b59e28b8fdf1a1feb34f122c9810642282d5d9530fb4ef AS build
FROM ocaml/opam:debian-11-ocaml-4.14@sha256:b83fcce3b715fe10ee2d3060763379e1ad9be76832d67203652f2c0abd6ae50d AS build
RUN sudo apt-get update && sudo apt-get install libev-dev capnproto m4 pkg-config libsqlite3-dev libgmp-dev -y --no-install-recommends
RUN cd ~/opam-repository && git pull origin -q master && git reset --hard d811dfbb1b8dd5497c24d29bb56a7b7cb5d6a25f && opam update
RUN cd ~/opam-repository && git pull origin -q master && git reset --hard 11e634fd946c90fdb26c14ae5f7759e644c898f0 && opam update
COPY --chown=opam ocluster-api.opam ocluster.opam /src/
COPY --chown=opam obuilder/obuilder.opam obuilder/obuilder-spec.opam /src/obuilder/
RUN opam pin -yn /src/obuilder/
Expand Down
2 changes: 1 addition & 1 deletion bin/scheduler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module Web = struct
let uri = Request.uri req in
match Request.meth req, Astring.String.cuts ~empty:false ~sep:"/" (Uri.path uri) with
| `GET, ["metrics"] ->
let data = Prometheus.CollectorRegistry.(collect default) in
Prometheus.CollectorRegistry.(collect default) >>= fun data ->
let body = Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data in
let headers = Header.init_with "Content-Type" "text/plain; version=0.0.4" in
Server.respond_string ~status:`OK ~headers ~body ()
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
(digestif (>= 0.8))
fpath
lwt-dllist
(prometheus-app (>= 1.1))
(prometheus-app (>= 1.2))
cohttp-lwt-unix
sqlite3
obuilder
Expand Down
2 changes: 1 addition & 1 deletion obuilder
2 changes: 1 addition & 1 deletion ocluster.opam
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ depends: [
"digestif" {>= "0.8"}
"fpath"
"lwt-dllist"
"prometheus-app" {>= "1.1"}
"prometheus-app" {>= "1.2"}
"cohttp-lwt-unix"
"sqlite3"
"obuilder"
Expand Down
6 changes: 3 additions & 3 deletions test/test_plugin.ml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ let cancel_rate_limit () =

let test_case name fn =
Alcotest_lwt.test_case name `Quick @@ fun _ () ->
fn () >|= fun () ->
Prometheus.CollectorRegistry.(collect default)
|> Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output
fn () >>= fun () ->
Prometheus.CollectorRegistry.(collect default) >|= fun data ->
Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data
|> String.split_on_char '\n'
|> List.iter (fun line ->
if Astring.String.is_prefix ~affix:"scheduler_pool_" line ||
Expand Down
6 changes: 3 additions & 3 deletions test/test_scheduling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ let run fn =
Lwt.pause () >>= fun () -> (* Ensure we're inside the Lwt mainloop. Lwt.pause behaves strangely otherwise. *)
Fake_time.now := 1.0;
fn () >>= fun () ->
Lwt.pause () >|= fun () ->
Prometheus.CollectorRegistry.(collect default)
|> Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output
Lwt.pause () >>= fun () ->
Prometheus.CollectorRegistry.(collect default) >|= fun data ->
Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data
|> String.split_on_char '\n'
|> List.iter (fun line ->
if Astring.String.is_prefix ~affix:"scheduler_pool_" line then (
Expand Down
2 changes: 1 addition & 1 deletion worker/cluster_worker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ let default_build ?obuilder ~switch ~log ~src ~secrets = function

let metrics = function
| `Agent ->
let data = Prometheus.CollectorRegistry.(collect default) in
Prometheus.CollectorRegistry.(collect default) >>= fun data ->
let content_type = "text/plain; version=0.0.4; charset=utf-8" in
Lwt_result.return (content_type, Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data)
| `Host ->
Expand Down