package tally-mnet
Build not yet checkedInstall
dune-project
Dependency
Authors
Maintainers
Sources
md5=bc38b35dc0e1980b8fbdcd859247c7e8
sha512=897381ed07de278601cf67ecd18528817c251761281980f2db403f505a79721e2fba659b9ebb82cdc651d961bad634e1a587c0772a55f3b2c5c925f64261ce58
Description
Tally provides measurements of counters in the OCaml ecosystem. Providing measurements is separated from reporting these.
Added to opam-repository:
README
Tally - collecting metrics of OCaml applications
Tally is a library to collect and output counters of OCaml applications. The output can be send to InfluxDB (via Telegraf), and then visualized with Grafana.
The API of a tally is simple: each tally has a name (which is the measurement name), a set of tags (key and value are string), and a set of fields (with key being a string, and value an int).
Base tallies are already implemented by this library: gc uses Gc.quick_stat, logs exposes the Logs.warn_count () and Logs.err_count ().
An example application would use:
let pid = Unix.getpid () in
let _ru = Tally_rusage.v pid in
let more_tags = [ "process", "my-application" ; "pid", string_of_int pid ] in
let measurements = Tally.measure () in
let influx_data =
List.map (fun name tags fields ->
Tally.encode_influx name ~tags:(more_tags @ tags) fields)
measurements |> String.concat ""
in
let socket = Unix.(socket PF_INET SOCK_STREAM 0) in
Unix.connect socket Unix.(ADDR_INET (inet_addr_loopback, 8096));
let _written =
Unix.write socket (Bytes.of_string influx_data) 0 (String.length influx_data)
in
()Tally-rusage
The sublibrary tally.rusage provides Tally_rusage.v pid to collect resource usage from the host system about a process. This uses /proc/<pid>/stat and /proc/<pid>/status on Linux, and ctl_kern.kern_proc.kern_proc_pid on FreeBSD.
Tally-mkernel
The separate opam package tally-mkernel collects metrics from mkernel devices and the ocaml-solo5 malloc implementation.
Tally-mnet
The separate opam package tally-mnet uses mnet and reports collected metrics to Influx/Telegraf.
Comparison to other metric libraries
The library metrics has a similar goal, but uses a more involved API for fields, and tags (with GADTs - where the keys and values may have more types). It also introduces more buereaucracy with graphs and also provides interaction with GNUplot.
The library prometheus is tied to the monitoring system Prometheus.
Tally is not tied to any monitoring system, contributions for more operating systems as well as further monitoring systems are appreciated - though the latter may be best provided by separate packages.
Installation
It is released to opam-repository, so an opam install tally or opam install tally-mkernel will make this package available.
LICENSE
It is licensed under the AGPL-3.0 or later. If you want to pay for a more permissive license, reach out to team@robur.coop.
AI
Contributions involving AI must comply with the rules set out here. If they do not comply, we reserve the right to reject your contribution.
Dependencies (7)
Dev Dependencies
None
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building tally-mnet with each compiler on check.ci.ocaml.org, run of against opam-repository 6e2873f. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
This version is not in the latest run; the versions below are.
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure