mirror of https://github.com/telemt/telemt.git
Merge 9b64d2ee17 into 7fe38f1b9f
This commit is contained in:
commit
c021995a0d
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
***Löst Probleme, bevor andere überhaupt wissen, dass sie existieren*** / ***It solves problems before others even realize they exist***
|
***Löst Probleme, bevor andere überhaupt wissen, dass sie existieren*** / ***It solves problems before others even realize they exist***
|
||||||
|
|
||||||
[**Telemt Chat in Telegram**](https://t.me/telemtrs)
|
### [**Telemt Chat in Telegram**](https://t.me/telemtrs)
|
||||||
|
|
||||||
**Telemt** is a fast, secure, and feature-rich server written in Rust: it fully implements the official Telegram proxy algo and adds many production-ready improvements such as:
|
**Telemt** is a fast, secure, and feature-rich server written in Rust: it fully implements the official Telegram proxy algo and adds many production-ready improvements such as:
|
||||||
- [ME Pool + Reader/Writer + Registry + Refill + Adaptive Floor + Trio-State + Generation Lifecycle](https://github.com/telemt/telemt/blob/main/docs/model/MODEL.en.md)
|
- [ME Pool + Reader/Writer + Registry + Refill + Adaptive Floor + Trio-State + Generation Lifecycle](https://github.com/telemt/telemt/blob/main/docs/model/MODEL.en.md)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -234,6 +234,17 @@ async fn render_metrics(stats: &Stats, config: &ProxyConfig, ip_tracker: &UserIp
|
||||||
let me_allows_normal = telemetry.me_level.allows_normal();
|
let me_allows_normal = telemetry.me_level.allows_normal();
|
||||||
let me_allows_debug = telemetry.me_level.allows_debug();
|
let me_allows_debug = telemetry.me_level.allows_debug();
|
||||||
|
|
||||||
|
let _ = writeln!(
|
||||||
|
out,
|
||||||
|
"# HELP telemt_build_info Build information for the running telemt binary"
|
||||||
|
);
|
||||||
|
let _ = writeln!(out, "# TYPE telemt_build_info gauge");
|
||||||
|
let _ = writeln!(
|
||||||
|
out,
|
||||||
|
"telemt_build_info{{version=\"{}\"}} 1",
|
||||||
|
env!("CARGO_PKG_VERSION")
|
||||||
|
);
|
||||||
|
|
||||||
let _ = writeln!(out, "# HELP telemt_uptime_seconds Proxy uptime");
|
let _ = writeln!(out, "# HELP telemt_uptime_seconds Proxy uptime");
|
||||||
let _ = writeln!(out, "# TYPE telemt_uptime_seconds gauge");
|
let _ = writeln!(out, "# TYPE telemt_uptime_seconds gauge");
|
||||||
let _ = writeln!(out, "telemt_uptime_seconds {:.1}", stats.uptime_secs());
|
let _ = writeln!(out, "telemt_uptime_seconds {:.1}", stats.uptime_secs());
|
||||||
|
|
@ -2775,6 +2786,10 @@ mod tests {
|
||||||
|
|
||||||
let output = render_metrics(&stats, &config, &tracker).await;
|
let output = render_metrics(&stats, &config, &tracker).await;
|
||||||
|
|
||||||
|
assert!(output.contains(&format!(
|
||||||
|
"telemt_build_info{{version=\"{}\"}} 1",
|
||||||
|
env!("CARGO_PKG_VERSION")
|
||||||
|
)));
|
||||||
assert!(output.contains("telemt_connections_total 2"));
|
assert!(output.contains("telemt_connections_total 2"));
|
||||||
assert!(output.contains("telemt_connections_bad_total 1"));
|
assert!(output.contains("telemt_connections_bad_total 1"));
|
||||||
assert!(output.contains("telemt_handshake_timeouts_total 1"));
|
assert!(output.contains("telemt_handshake_timeouts_total 1"));
|
||||||
|
|
@ -2867,6 +2882,7 @@ mod tests {
|
||||||
let tracker = UserIpTracker::new();
|
let tracker = UserIpTracker::new();
|
||||||
let config = ProxyConfig::default();
|
let config = ProxyConfig::default();
|
||||||
let output = render_metrics(&stats, &config, &tracker).await;
|
let output = render_metrics(&stats, &config, &tracker).await;
|
||||||
|
assert!(output.contains("# TYPE telemt_build_info gauge"));
|
||||||
assert!(output.contains("# TYPE telemt_uptime_seconds gauge"));
|
assert!(output.contains("# TYPE telemt_uptime_seconds gauge"));
|
||||||
assert!(output.contains("# TYPE telemt_connections_total counter"));
|
assert!(output.contains("# TYPE telemt_connections_total counter"));
|
||||||
assert!(output.contains("# TYPE telemt_connections_bad_total counter"));
|
assert!(output.contains("# TYPE telemt_connections_bad_total counter"));
|
||||||
|
|
@ -2924,6 +2940,14 @@ mod tests {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.contains("telemt_connections_total 3")
|
.contains("telemt_connections_total 3")
|
||||||
);
|
);
|
||||||
|
assert!(
|
||||||
|
std::str::from_utf8(body.as_ref())
|
||||||
|
.unwrap()
|
||||||
|
.contains(&format!(
|
||||||
|
"telemt_build_info{{version=\"{}\"}} 1",
|
||||||
|
env!("CARGO_PKG_VERSION")
|
||||||
|
))
|
||||||
|
);
|
||||||
|
|
||||||
config.general.beobachten = true;
|
config.general.beobachten = true;
|
||||||
config.general.beobachten_minutes = 10;
|
config.general.beobachten_minutes = 10;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue