mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
udp: improve peer client statistics
This commit is contained in:
parent
1ddac59fee
commit
da25d60a5d
7 changed files with 159 additions and 75 deletions
|
|
@ -4,6 +4,7 @@ pub mod workers;
|
|||
|
||||
use std::collections::BTreeMap;
|
||||
use std::thread::Builder;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Context;
|
||||
use crossbeam_channel::{bounded, unbounded};
|
||||
|
|
@ -143,8 +144,13 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
|
|||
#[cfg(feature = "prometheus")]
|
||||
if config.statistics.run_prometheus_endpoint {
|
||||
use metrics_exporter_prometheus::PrometheusBuilder;
|
||||
use metrics_util::MetricKindMask;
|
||||
|
||||
PrometheusBuilder::new()
|
||||
.idle_timeout(
|
||||
MetricKindMask::ALL,
|
||||
Some(Duration::from_secs(config.statistics.interval * 2)),
|
||||
)
|
||||
.with_http_listener(config.statistics.prometheus_endpoint_address)
|
||||
.install()
|
||||
.with_context(|| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue