提交 231c36c7 authored 作者: Serhij S's avatar Serhij S

0.1.45

上级 19a9d57d
[package]
name = "roboplc"
version = "0.1.44"
version = "0.1.45"
edition = "2021"
authors = ["Serhij S. <div@altertech.com>"]
license = "Apache-2.0"
......
......@@ -254,11 +254,19 @@ pub fn suicide(delay: Duration, warn: bool) {
};
}
/// Sets up Prometheus metrics exporter
/// Returns [Prometheus metrics exporter
/// builder](https://docs.rs/metrics-exporter-prometheus/0.14.0/metrics_exporter_prometheus/)
///
/// # Example
///
/// ```rust,no_run
/// roboplc::metrics_exporter()
/// .set_bucket_duration(std::time::Duration::from_secs(300)).unwrap()
/// .install().unwrap();
/// ```
#[cfg(feature = "metrics")]
pub fn setup_metrics_exporter() -> Result<()> {
let builder = metrics_exporter_prometheus::PrometheusBuilder::new();
builder.install().map_err(Error::io)
pub fn metrics_exporter() -> metrics_exporter_prometheus::PrometheusBuilder {
metrics_exporter_prometheus::PrometheusBuilder::new()
}
/// Sets panic handler to immediately kill the process and its childs with SIGKILL
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论