mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 08:06:37 +08:00
feat(frontend): 观测网络字节字段与 UV 文案对齐
网络图仅使用 bytes_provided/received;看板与节点 UV 改为 24h/查询窗口 独立访客;清理 traffic_reports 与 openresty 吞吐兼容字段;运维清理目标 改为 node_edge_health。
This commit is contained in:
@@ -130,11 +130,19 @@ function normalizeNetworkTrendPoints(
|
||||
bucket_started_at: String(item[0] ?? ''),
|
||||
network_rx_bytes: Number(item[1] ?? 0),
|
||||
network_tx_bytes: Number(item[2] ?? 0),
|
||||
openresty_rx_bytes: Number(item[3] ?? 0),
|
||||
openresty_tx_bytes: Number(item[4] ?? 0),
|
||||
bytes_received: Number(item[3] ?? 0),
|
||||
bytes_provided: Number(item[4] ?? 0),
|
||||
reported_nodes: Number(item[5] ?? 0),
|
||||
}
|
||||
: item,
|
||||
: {
|
||||
...item,
|
||||
bytes_received: Number(
|
||||
(item as { bytes_received?: number }).bytes_received ?? 0,
|
||||
),
|
||||
bytes_provided: Number(
|
||||
(item as { bytes_provided?: number }).bytes_provided ?? 0,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ export type {
|
||||
NodeObservabilityAnalytics,
|
||||
NodeObservabilityTrends,
|
||||
NodeSystemProfile,
|
||||
NodeTrafficReport,
|
||||
NodeStatus,
|
||||
NodeType,
|
||||
OpenrestyStatus,
|
||||
|
||||
@@ -122,8 +122,6 @@ export interface NodeMetricSnapshot {
|
||||
disk_write_bytes: number;
|
||||
network_rx_bytes: number;
|
||||
network_tx_bytes: number;
|
||||
openresty_rx_bytes: number;
|
||||
openresty_tx_bytes: number;
|
||||
openresty_connections: number;
|
||||
}
|
||||
|
||||
@@ -139,17 +137,6 @@ export interface NodeHealthEvent {
|
||||
resolved_at?: string | null;
|
||||
}
|
||||
|
||||
export interface NodeTrafficReport {
|
||||
window_started_at: string;
|
||||
window_ended_at: string;
|
||||
request_count: number;
|
||||
error_count: number;
|
||||
unique_visitor_count: number;
|
||||
status_codes_json: string;
|
||||
top_domains_json: string;
|
||||
source_countries_json: string;
|
||||
}
|
||||
|
||||
export interface NodeTrafficSummary {
|
||||
window_started_at: string;
|
||||
window_ended_at: string;
|
||||
@@ -194,7 +181,6 @@ export interface NodeObservability {
|
||||
node_id: string;
|
||||
profile: NodeSystemProfile | null;
|
||||
metric_snapshots: NodeMetricSnapshot[];
|
||||
traffic_reports?: NodeTrafficReport[];
|
||||
health_events: NodeHealthEvent[];
|
||||
analytics?: NodeObservabilityAnalytics;
|
||||
trends?: NodeObservabilityTrends;
|
||||
@@ -665,7 +651,11 @@ export interface GeoIPLookupResult {
|
||||
}
|
||||
|
||||
export type DatabaseCleanupTarget =
|
||||
'node_access_logs' | 'node_metric_snapshots' | 'node_request_reports';
|
||||
| 'node_access_logs'
|
||||
| 'node_metric_snapshots'
|
||||
| 'node_edge_health'
|
||||
| 'node_obs_frps'
|
||||
| 'node_obs_frpc';
|
||||
|
||||
export interface DatabaseCleanupPayload {
|
||||
target: DatabaseCleanupTarget;
|
||||
@@ -936,8 +926,10 @@ export interface NetworkTrendPoint {
|
||||
bucket_started_at: string;
|
||||
network_rx_bytes: number;
|
||||
network_tx_bytes: number;
|
||||
openresty_rx_bytes: number;
|
||||
openresty_tx_bytes: number;
|
||||
/** L1 接收数据 sum(request_length) */
|
||||
bytes_received: number;
|
||||
/** L1 已提供数据 sum(bytes_sent) */
|
||||
bytes_provided: number;
|
||||
reported_nodes: number;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user