mirror of https://github.com/telemt/telemt.git
ME Pool in Metrics
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
parent
71261522bd
commit
3799fc13c4
|
|
@ -449,6 +449,21 @@ async fn render_metrics(stats: &Stats, config: &ProxyConfig, ip_tracker: &UserIp
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let _ = writeln!(
|
||||||
|
out,
|
||||||
|
"# HELP telemt_me_kdf_port_only_drift_total ME KDF client-port changes with stable non-port material"
|
||||||
|
);
|
||||||
|
let _ = writeln!(out, "# TYPE telemt_me_kdf_port_only_drift_total counter");
|
||||||
|
let _ = writeln!(
|
||||||
|
out,
|
||||||
|
"telemt_me_kdf_port_only_drift_total {}",
|
||||||
|
if me_allows_debug {
|
||||||
|
stats.get_me_kdf_port_only_drift_total()
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let _ = writeln!(
|
let _ = writeln!(
|
||||||
out,
|
out,
|
||||||
"# HELP telemt_me_hardswap_pending_reuse_total Hardswap cycles that reused an existing pending generation"
|
"# HELP telemt_me_hardswap_pending_reuse_total Hardswap cycles that reused an existing pending generation"
|
||||||
|
|
@ -587,6 +602,24 @@ async fn render_metrics(stats: &Stats, config: &ProxyConfig, ip_tracker: &UserIp
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let _ = writeln!(
|
||||||
|
out,
|
||||||
|
"# HELP telemt_me_single_endpoint_shadow_rotate_skipped_quarantine_total Shadow rotations skipped because endpoint is quarantined"
|
||||||
|
);
|
||||||
|
let _ = writeln!(
|
||||||
|
out,
|
||||||
|
"# TYPE telemt_me_single_endpoint_shadow_rotate_skipped_quarantine_total counter"
|
||||||
|
);
|
||||||
|
let _ = writeln!(
|
||||||
|
out,
|
||||||
|
"telemt_me_single_endpoint_shadow_rotate_skipped_quarantine_total {}",
|
||||||
|
if me_allows_normal {
|
||||||
|
stats.get_me_single_endpoint_shadow_rotate_skipped_quarantine_total()
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let _ = writeln!(out, "# HELP telemt_secure_padding_invalid_total Invalid secure frame lengths");
|
let _ = writeln!(out, "# HELP telemt_secure_padding_invalid_total Invalid secure frame lengths");
|
||||||
let _ = writeln!(out, "# TYPE telemt_secure_padding_invalid_total counter");
|
let _ = writeln!(out, "# TYPE telemt_secure_padding_invalid_total counter");
|
||||||
let _ = writeln!(
|
let _ = writeln!(
|
||||||
|
|
@ -679,7 +712,7 @@ async fn render_metrics(stats: &Stats, config: &ProxyConfig, ip_tracker: &UserIp
|
||||||
let _ = writeln!(
|
let _ = writeln!(
|
||||||
out,
|
out,
|
||||||
"telemt_pool_swap_total {}",
|
"telemt_pool_swap_total {}",
|
||||||
if me_allows_debug {
|
if me_allows_normal {
|
||||||
stats.get_pool_swap_total()
|
stats.get_pool_swap_total()
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ pub struct Stats {
|
||||||
me_seq_mismatch: AtomicU64,
|
me_seq_mismatch: AtomicU64,
|
||||||
me_endpoint_quarantine_total: AtomicU64,
|
me_endpoint_quarantine_total: AtomicU64,
|
||||||
me_kdf_drift_total: AtomicU64,
|
me_kdf_drift_total: AtomicU64,
|
||||||
|
me_kdf_port_only_drift_total: AtomicU64,
|
||||||
me_hardswap_pending_reuse_total: AtomicU64,
|
me_hardswap_pending_reuse_total: AtomicU64,
|
||||||
me_hardswap_pending_ttl_expired_total: AtomicU64,
|
me_hardswap_pending_ttl_expired_total: AtomicU64,
|
||||||
me_single_endpoint_outage_enter_total: AtomicU64,
|
me_single_endpoint_outage_enter_total: AtomicU64,
|
||||||
|
|
@ -46,6 +47,7 @@ pub struct Stats {
|
||||||
me_single_endpoint_outage_reconnect_success_total: AtomicU64,
|
me_single_endpoint_outage_reconnect_success_total: AtomicU64,
|
||||||
me_single_endpoint_quarantine_bypass_total: AtomicU64,
|
me_single_endpoint_quarantine_bypass_total: AtomicU64,
|
||||||
me_single_endpoint_shadow_rotate_total: AtomicU64,
|
me_single_endpoint_shadow_rotate_total: AtomicU64,
|
||||||
|
me_single_endpoint_shadow_rotate_skipped_quarantine_total: AtomicU64,
|
||||||
me_handshake_error_codes: DashMap<i32, AtomicU64>,
|
me_handshake_error_codes: DashMap<i32, AtomicU64>,
|
||||||
me_route_drop_no_conn: AtomicU64,
|
me_route_drop_no_conn: AtomicU64,
|
||||||
me_route_drop_channel_closed: AtomicU64,
|
me_route_drop_channel_closed: AtomicU64,
|
||||||
|
|
@ -290,7 +292,7 @@ impl Stats {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn increment_pool_swap_total(&self) {
|
pub fn increment_pool_swap_total(&self) {
|
||||||
if self.telemetry_me_allows_debug() {
|
if self.telemetry_me_allows_normal() {
|
||||||
self.pool_swap_total.fetch_add(1, Ordering::Relaxed);
|
self.pool_swap_total.fetch_add(1, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -377,6 +379,12 @@ impl Stats {
|
||||||
self.me_kdf_drift_total.fetch_add(1, Ordering::Relaxed);
|
self.me_kdf_drift_total.fetch_add(1, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn increment_me_kdf_port_only_drift_total(&self) {
|
||||||
|
if self.telemetry_me_allows_debug() {
|
||||||
|
self.me_kdf_port_only_drift_total
|
||||||
|
.fetch_add(1, Ordering::Relaxed);
|
||||||
|
}
|
||||||
|
}
|
||||||
pub fn increment_me_hardswap_pending_reuse_total(&self) {
|
pub fn increment_me_hardswap_pending_reuse_total(&self) {
|
||||||
if self.telemetry_me_allows_debug() {
|
if self.telemetry_me_allows_debug() {
|
||||||
self.me_hardswap_pending_reuse_total
|
self.me_hardswap_pending_reuse_total
|
||||||
|
|
@ -425,6 +433,12 @@ impl Stats {
|
||||||
.fetch_add(1, Ordering::Relaxed);
|
.fetch_add(1, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn increment_me_single_endpoint_shadow_rotate_skipped_quarantine_total(&self) {
|
||||||
|
if self.telemetry_me_allows_normal() {
|
||||||
|
self.me_single_endpoint_shadow_rotate_skipped_quarantine_total
|
||||||
|
.fetch_add(1, Ordering::Relaxed);
|
||||||
|
}
|
||||||
|
}
|
||||||
pub fn get_connects_all(&self) -> u64 { self.connects_all.load(Ordering::Relaxed) }
|
pub fn get_connects_all(&self) -> u64 { self.connects_all.load(Ordering::Relaxed) }
|
||||||
pub fn get_connects_bad(&self) -> u64 { self.connects_bad.load(Ordering::Relaxed) }
|
pub fn get_connects_bad(&self) -> u64 { self.connects_bad.load(Ordering::Relaxed) }
|
||||||
pub fn get_me_keepalive_sent(&self) -> u64 { self.me_keepalive_sent.load(Ordering::Relaxed) }
|
pub fn get_me_keepalive_sent(&self) -> u64 { self.me_keepalive_sent.load(Ordering::Relaxed) }
|
||||||
|
|
@ -447,6 +461,9 @@ impl Stats {
|
||||||
pub fn get_me_kdf_drift_total(&self) -> u64 {
|
pub fn get_me_kdf_drift_total(&self) -> u64 {
|
||||||
self.me_kdf_drift_total.load(Ordering::Relaxed)
|
self.me_kdf_drift_total.load(Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
|
pub fn get_me_kdf_port_only_drift_total(&self) -> u64 {
|
||||||
|
self.me_kdf_port_only_drift_total.load(Ordering::Relaxed)
|
||||||
|
}
|
||||||
pub fn get_me_hardswap_pending_reuse_total(&self) -> u64 {
|
pub fn get_me_hardswap_pending_reuse_total(&self) -> u64 {
|
||||||
self.me_hardswap_pending_reuse_total
|
self.me_hardswap_pending_reuse_total
|
||||||
.load(Ordering::Relaxed)
|
.load(Ordering::Relaxed)
|
||||||
|
|
@ -479,6 +496,10 @@ impl Stats {
|
||||||
self.me_single_endpoint_shadow_rotate_total
|
self.me_single_endpoint_shadow_rotate_total
|
||||||
.load(Ordering::Relaxed)
|
.load(Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
|
pub fn get_me_single_endpoint_shadow_rotate_skipped_quarantine_total(&self) -> u64 {
|
||||||
|
self.me_single_endpoint_shadow_rotate_skipped_quarantine_total
|
||||||
|
.load(Ordering::Relaxed)
|
||||||
|
}
|
||||||
pub fn get_me_handshake_error_code_counts(&self) -> Vec<(i32, u64)> {
|
pub fn get_me_handshake_error_code_counts(&self) -> Vec<(i32, u64)> {
|
||||||
let mut out: Vec<(i32, u64)> = self
|
let mut out: Vec<(i32, u64)> = self
|
||||||
.me_handshake_error_codes
|
.me_handshake_error_codes
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue