mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
feat(proxy): record tunnel stability metrics
This commit is contained in:
@@ -39,7 +39,48 @@ CREATE TABLE IF NOT EXISTS proxy_node_events (
|
||||
`node_id` VARCHAR(64) NOT NULL,
|
||||
`event_type` VARCHAR(64) NOT NULL,
|
||||
`detail` VARCHAR(500),
|
||||
`event_metadata` JSON,
|
||||
`created_at` BIGINT NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS proxy_node_metrics_1m (
|
||||
`node_id` VARCHAR(64) NOT NULL,
|
||||
`bucket_start_unix_secs` BIGINT NOT NULL,
|
||||
`samples` BIGINT NOT NULL DEFAULT 0,
|
||||
`uptime_samples` BIGINT NOT NULL DEFAULT 0,
|
||||
`active_connections_sum` BIGINT NOT NULL DEFAULT 0,
|
||||
`active_connections_max` BIGINT NOT NULL DEFAULT 0,
|
||||
`heartbeat_rtt_ms_sum` BIGINT NOT NULL DEFAULT 0,
|
||||
`heartbeat_rtt_ms_max` BIGINT NOT NULL DEFAULT 0,
|
||||
`connect_errors_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`disconnects_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`error_events_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`ws_in_bytes_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`ws_out_bytes_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`ws_in_frames_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`ws_out_frames_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`node_id`, `bucket_start_unix_secs`),
|
||||
KEY idx_proxy_node_metrics_1m_bucket_start (`bucket_start_unix_secs`)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS proxy_node_metrics_1h (
|
||||
`node_id` VARCHAR(64) NOT NULL,
|
||||
`bucket_start_unix_secs` BIGINT NOT NULL,
|
||||
`samples` BIGINT NOT NULL DEFAULT 0,
|
||||
`uptime_samples` BIGINT NOT NULL DEFAULT 0,
|
||||
`active_connections_sum` BIGINT NOT NULL DEFAULT 0,
|
||||
`active_connections_max` BIGINT NOT NULL DEFAULT 0,
|
||||
`heartbeat_rtt_ms_sum` BIGINT NOT NULL DEFAULT 0,
|
||||
`heartbeat_rtt_ms_max` BIGINT NOT NULL DEFAULT 0,
|
||||
`connect_errors_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`disconnects_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`error_events_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`ws_in_bytes_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`ws_out_bytes_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`ws_in_frames_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
`ws_out_frames_delta` BIGINT NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`node_id`, `bucket_start_unix_secs`),
|
||||
KEY idx_proxy_node_metrics_1h_bucket_start (`bucket_start_unix_secs`)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user