mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-28 02:40:25 +08:00
合并部分流量查询和带宽查询
This commit is contained in:
@@ -1 +1,38 @@
|
||||
package models
|
||||
|
||||
func (this *ServerDailyStat) AsUserBandwidthStat() *UserBandwidthStat {
|
||||
return &UserBandwidthStat{
|
||||
Id: 0,
|
||||
UserId: uint64(this.UserId),
|
||||
RegionId: this.RegionId,
|
||||
Day: this.Day,
|
||||
TimeAt: this.TimeFrom[:4],
|
||||
Bytes: this.Bytes / 300,
|
||||
TotalBytes: this.Bytes,
|
||||
AvgBytes: this.Bytes / 300,
|
||||
CachedBytes: this.CachedBytes,
|
||||
AttackBytes: this.AttackBytes,
|
||||
CountRequests: this.CountRequests,
|
||||
CountCachedRequests: this.CountCachedRequests,
|
||||
CountAttackRequests: this.CountAttackRequests,
|
||||
}
|
||||
}
|
||||
|
||||
func (this *ServerDailyStat) AsServerBandwidthStat() *ServerBandwidthStat {
|
||||
return &ServerBandwidthStat{
|
||||
Id: 0,
|
||||
UserId: uint64(this.UserId),
|
||||
ServerId: uint64(this.ServerId),
|
||||
RegionId: this.RegionId,
|
||||
Day: this.Day,
|
||||
TimeAt: this.TimeFrom[:4],
|
||||
Bytes: this.Bytes / 300,
|
||||
TotalBytes: this.Bytes,
|
||||
AvgBytes: this.Bytes / 300,
|
||||
CachedBytes: this.CachedBytes,
|
||||
AttackBytes: this.AttackBytes,
|
||||
CountRequests: this.CountRequests,
|
||||
CountCachedRequests: this.CountCachedRequests,
|
||||
CountAttackRequests: this.CountAttackRequests,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user