mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 14:06:36 +08:00
a4dd5ca9e1
- 24 小时请求趋势拆分展示请求总量与 200/400/500 状态码请求量,独占一行; 时间桶聚合新增 status_200/400/500_count(CH countIf、PG FILTER), 请求趋势改为基于原始桶聚合(小时 rollup 无状态码口径) - 首页移除宿主机磁盘指标,容量趋势(CPU/内存)并入业务流量卡片展示 - 压缩协议 traffic_24h 扩展为 7 元组,前端归一化同步更新
69 lines
2.6 KiB
Go
69 lines
2.6 KiB
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package analytics
|
|
|
|
// NodeAccessLogBucketAggregate is a folded bucket aggregate row.
|
|
type NodeAccessLogBucketAggregate struct {
|
|
BucketEpoch int64 `gorm:"column:bucket_epoch"`
|
|
RequestCount int64 `gorm:"column:request_count"`
|
|
SuccessCount int64 `gorm:"column:success_count"`
|
|
ClientErrorCount int64 `gorm:"column:client_error_count"`
|
|
ServerErrorCount int64 `gorm:"column:server_error_count"`
|
|
Status2xxCount int64 `gorm:"column:status_2xx_count"`
|
|
Status4xxCount int64 `gorm:"column:status_4xx_count"`
|
|
Status5xxCount int64 `gorm:"column:status_5xx_count"`
|
|
UniqueIPCount int64 `gorm:"column:unique_ip_count"`
|
|
UniqueHostCount int64 `gorm:"column:unique_host_count"`
|
|
BytesSent int64 `gorm:"column:bytes_sent"`
|
|
RequestLength int64 `gorm:"column:request_length"`
|
|
}
|
|
|
|
// NodeAccessLogWAFIPAggregate is a per-IP aggregate row for WAF automatic rules.
|
|
type NodeAccessLogWAFIPAggregate struct {
|
|
RemoteAddr string
|
|
RequestCount int64
|
|
Status404Count int64
|
|
ClientErrorCount int64
|
|
ServerErrorCount int64
|
|
IPHostCount int64
|
|
LastSeenEpoch int64
|
|
StatusCounts map[int]int64
|
|
}
|
|
|
|
// NodeAccessLogBucketDimension is a bucket dimension value.
|
|
type NodeAccessLogBucketDimension struct {
|
|
BucketEpoch int64 `gorm:"column:bucket_epoch"`
|
|
Value string `gorm:"column:value"`
|
|
}
|
|
|
|
// NodeAccessLogIPAggregate is an IP aggregate row.
|
|
type NodeAccessLogIPAggregate struct {
|
|
RemoteAddr string `gorm:"column:remote_addr"`
|
|
RequestCount int64 `gorm:"column:request_count"`
|
|
SuccessCount int64 `gorm:"column:success_count"`
|
|
ClientErrorCount int64 `gorm:"column:client_error_count"`
|
|
ServerErrorCount int64 `gorm:"column:server_error_count"`
|
|
LastSeenEpoch int64 `gorm:"column:last_seen_epoch"`
|
|
}
|
|
|
|
// NodeAccessLogIPSummary is an IP summary row.
|
|
type NodeAccessLogIPSummary struct {
|
|
RemoteAddr string `gorm:"column:remote_addr"`
|
|
Region string `gorm:"column:region"`
|
|
TotalRequests int64 `gorm:"column:total_requests"`
|
|
Success2xxCount int64 `gorm:"column:success_2xx_count"`
|
|
SuccessRatio float64 `gorm:"column:success_ratio"`
|
|
BytesReceived int64 `gorm:"column:request_length"`
|
|
BytesSent int64 `gorm:"column:bytes_sent"`
|
|
// RecentRequests is deprecated (always 0); kept for wire compatibility.
|
|
RecentRequests int64 `gorm:"column:recent_requests"`
|
|
LastSeenEpoch int64 `gorm:"column:last_seen_epoch"`
|
|
}
|
|
|
|
// NodeAccessLogIPTrend is an IP trend bucket row.
|
|
type NodeAccessLogIPTrend struct {
|
|
BucketEpoch int64 `gorm:"column:bucket_epoch"`
|
|
RequestCount int64 `gorm:"column:request_count"`
|
|
}
|