fix: корректная агрегация top peers по диапазонам и починка hourly bucket

This commit is contained in:
2026-05-09 21:31:03 +05:00
parent b6c86009e6
commit 1db7f24d5c
4 changed files with 42 additions and 14 deletions
@@ -1,10 +1,10 @@
package entity
type TrafficAggregateHourly struct {
PeerId *int64 `gorm:"column:peer_id;default:0;primaryKey" json:"peerId"`
HourStart *int64 `gorm:"column:hour_start;default:0;primaryKey" json:"hourStart"`
RxBytes *int64 `gorm:"column:rx_bytes;default:0" json:"rxBytes"`
TxBytes *int64 `gorm:"column:tx_bytes;default:0" json:"txBytes"`
PeerId *int64 `gorm:"column:peer_id;default:0;primaryKey" json:"peerId"`
HourStart *int64 `gorm:"column:hour_start;default:0;primaryKey" json:"hourStart"`
RxBytes *int64 `gorm:"column:rx_bytes;default:0" json:"rxBytes"`
TxBytes *int64 `gorm:"column:tx_bytes;default:0" json:"txBytes"`
}
func (TrafficAggregateHourly) TableName() string {