feat(api): support traffic bytes tracking in edge access logs and refactor analytics models

- Add `bytes_sent` to `NodeAccessLog` on both Agent and Master Server.
- Create ClickHouse migration `202607120001_add_bytes_sent_to_node_access_logs.sql`.
- Refactor duplicate stats structs by centralizing them into `analyticsmodel` package with type aliases.
- Simplify access log store delegations and remove redundant mapping loops.
- Regenerate Swagger documentation.
- Update changelog index.md.
This commit is contained in:
ryan
2026-07-12 17:27:57 +08:00
parent f02fc9676a
commit 41cd23a64d
19 changed files with 246 additions and 245 deletions
+19 -9
View File
@@ -656,6 +656,8 @@ definitions:
type: object
github_com_Rain-kl_Wavelet_pkg_protocol.NodeAccessLog:
properties:
bytes_sent:
type: integer
host:
type: string
logged_at_unix:
@@ -3964,33 +3966,41 @@ definitions:
zone.Stats:
properties:
available:
description: Available is false when analytics storage is unavailable (e.g.
ClickHouse off).
type: boolean
bucket_minutes:
type: integer
bytes_sent:
description: BytesSent is total response bytes. Currently always 0 until access
logs store body_bytes_sent.
type: integer
domain_count:
description: DomainCount is the number of explicit Zone domains used to scope
hosts.
type: integer
range:
$ref: '#/definitions/zone.StatsRange'
range_hours:
type: integer
request_count:
description: RequestCount is total access-log requests for Zone domains.
type: integer
series:
items:
$ref: '#/definitions/zone.StatsPoint'
type: array
unique_visitors:
description: UniqueVisitors is distinct client IPs (remote_addr) over the
window.
type: integer
window_ended_at:
type: string
window_started_at:
type: string
type: object
zone.StatsPoint:
properties:
bucket_started_at:
type: string
bytes_sent:
type: integer
request_count:
type: integer
unique_visitors:
type: integer
type: object
zone.StatsRange:
enum:
- 24h