diff --git a/src/monitor/mod.rs b/src/monitor/mod.rs index afe6eae..5910395 100644 --- a/src/monitor/mod.rs +++ b/src/monitor/mod.rs @@ -154,6 +154,8 @@ fn send_metrics(monitor: Monitor, handle: Handle) server.score().map(|s| r("score", s as u64)), Some(r("tx_bytes", traffic.tx_bytes as u64)), Some(r("rx_bytes", traffic.rx_bytes as u64)), + Some(r("conns.total", server.conn_total() as u64)), + Some(r("conns.alive", server.conn_alive() as u64)), ] }).filter_map(|v| v); let mut buf = Vec::new(); diff --git a/src/proxy/mod.rs b/src/proxy/mod.rs index 0301f86..f1bff65 100644 --- a/src/proxy/mod.rs +++ b/src/proxy/mod.rs @@ -199,6 +199,14 @@ impl ProxyServer { self.status().score } + pub fn conn_alive(&self) -> u32 { + self.status().conn_alive + } + + pub fn conn_total(&self) -> u32 { + self.status().conn_total + } + pub fn set_delay(&self, delay: Option) { self.status().delay = delay; self.status().score =