mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-21 12:12:48 +00:00
feat(database): server_traffic table for per-minute traffic rollups
One row per server and minute (packets, bytes, resends, HTTP requests, errors, bytes and latency percentiles), written in batches and read summed into buckets for the longer chart ranges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
20
migrations/dlu/mysql/84_server_traffic.sql
Normal file
20
migrations/dlu/mysql/84_server_traffic.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
/* Per-minute traffic of each server (packets, bytes, HTTP requests and latency), written by the dashboard once a minute
|
||||
from the servers' traffic reports and kept for traffic_days. server: master, auth, chat, dashboard, ugc or
|
||||
world:<zone>:<instance>. The latency columns are the HTTP latency percentiles of the minute in microseconds. */
|
||||
CREATE TABLE IF NOT EXISTS server_traffic (
|
||||
time BIGINT NOT NULL,
|
||||
server VARCHAR(64) NOT NULL,
|
||||
packets_in BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
packets_out BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
bytes_in BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
bytes_out BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
resends BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
http_requests BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
http_4xx BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
http_5xx BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
http_bytes_out BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
latency_p50_us INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
latency_p95_us INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
latency_p99_us INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (time, server)
|
||||
);
|
||||
18
migrations/dlu/sqlite/67_server_traffic.sql
Normal file
18
migrations/dlu/sqlite/67_server_traffic.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
/* Per-minute traffic of each server. See the MySQL migration. */
|
||||
CREATE TABLE IF NOT EXISTS server_traffic (
|
||||
time BIGINT NOT NULL,
|
||||
server TEXT NOT NULL,
|
||||
packets_in BIGINT NOT NULL DEFAULT 0,
|
||||
packets_out BIGINT NOT NULL DEFAULT 0,
|
||||
bytes_in BIGINT NOT NULL DEFAULT 0,
|
||||
bytes_out BIGINT NOT NULL DEFAULT 0,
|
||||
resends BIGINT NOT NULL DEFAULT 0,
|
||||
http_requests BIGINT NOT NULL DEFAULT 0,
|
||||
http_4xx BIGINT NOT NULL DEFAULT 0,
|
||||
http_5xx BIGINT NOT NULL DEFAULT 0,
|
||||
http_bytes_out BIGINT NOT NULL DEFAULT 0,
|
||||
latency_p50_us INTEGER NOT NULL DEFAULT 0,
|
||||
latency_p95_us INTEGER NOT NULL DEFAULT 0,
|
||||
latency_p99_us INTEGER NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (time, server)
|
||||
);
|
||||
Reference in New Issue
Block a user