add handshake failure stage accounting

This commit is contained in:
astronaut808
2026-07-18 20:46:00 +05:00
parent fabd98ce89
commit 4a5dc0b21b
9 changed files with 180 additions and 8 deletions
+9 -2
View File
@@ -54,8 +54,8 @@ use events::ApiEventStore;
use http_utils::{error_response, read_json, read_optional_json, success_response};
use model::{
ApiFailure, ClassCount, CreateUserRequest, DeleteUserResponse, HealthData, HealthReadyData,
PatchUserRequest, ResetUserQuotaResponse, RotateSecretRequest, SummaryData, UserActiveIps,
is_valid_username,
PatchUserRequest, ResetUserQuotaResponse, RotateSecretRequest, StageCount, SummaryData,
UserActiveIps, is_valid_username,
};
use patch::Patch;
use runtime_edge::{
@@ -540,12 +540,19 @@ async fn handle(
.into_iter()
.map(|(class, total)| ClassCount { class, total })
.collect();
let handshake_failures_by_stage = shared
.stats
.get_handshake_failure_stage_counts()
.into_iter()
.map(|(stage, total)| StageCount { stage, total })
.collect();
let data = SummaryData {
uptime_seconds: shared.stats.uptime_secs(),
connections_total: shared.stats.get_connects_all(),
connections_bad_total: shared.stats.get_connects_bad(),
connections_bad_by_class,
handshake_failures_by_class,
handshake_failures_by_stage,
handshake_timeouts_total: shared.stats.get_handshake_timeouts(),
configured_users: cfg.access.users.len(),
};