Skip to content

Commit

Permalink
add metrics using prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Jan 22, 2024
1 parent 4a0f495 commit 77a05de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion benchpress-server.opam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ depends: [
"gnuplot" { >= "0.6" & < "0.8" }
"sqlite3"
"sqlite3_utils" { >= "0.4" & < "0.5" }
"tiny_httpd" { >= "0.12" & < "1.0" }
"tiny_httpd" { >= "0.16" & < "1.0" }
"printbox" { >= "0.6" }
"printbox-text" { >= "0.6" }
"ocaml" {>= "4.12" }
Expand Down
5 changes: 5 additions & 0 deletions src/server/benchpress_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,11 @@ module Cmd = struct
"0.0.0.0"
in
let server = H.create ~max_connections:32 ~addr ?port () in

let prometheus = Tiny_httpd_prometheus.(global) in
Tiny_httpd_prometheus.instrument_server server prometheus;
Tiny_httpd_prometheus.GC_metrics.create_and_update_before_emit prometheus;

let data_dir = Misc.data_dir () in
let self =
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(into ../../)
(until-clean))
(libraries benchpress containers cmdliner result uuidm logs logs.cli
tiny_httpd sqlite3_utils base64 printbox jemalloc)
tiny_httpd tiny_httpd.prometheus sqlite3_utils base64 printbox jemalloc)
(flags :standard -warn-error -a+8 -safe-string -open Benchpress -linkall))

(rule
Expand Down

0 comments on commit 77a05de

Please sign in to comment.