mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-19 00:40:26 +08:00
实现峰值带宽和平均带宽两种带宽算法
This commit is contained in:
@@ -31,14 +31,15 @@ type ServerBandwidthStat struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"`
|
||||
ServerId int64 `protobuf:"varint,3,opt,name=serverId,proto3" json:"serverId,omitempty"`
|
||||
Day string `protobuf:"bytes,4,opt,name=day,proto3" json:"day,omitempty"`
|
||||
TimeAt string `protobuf:"bytes,5,opt,name=timeAt,proto3" json:"timeAt,omitempty"`
|
||||
Bytes int64 `protobuf:"varint,6,opt,name=bytes,proto3" json:"bytes,omitempty"`
|
||||
Bits int64 `protobuf:"varint,7,opt,name=bits,proto3" json:"bits,omitempty"`
|
||||
NodeRegionId int64 `protobuf:"varint,8,opt,name=nodeRegionId,proto3" json:"nodeRegionId,omitempty"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID
|
||||
UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` // 用户ID
|
||||
ServerId int64 `protobuf:"varint,3,opt,name=serverId,proto3" json:"serverId,omitempty"` //服务ID
|
||||
Day string `protobuf:"bytes,4,opt,name=day,proto3" json:"day,omitempty"` // 日期,格式YYYYMMDD
|
||||
TimeAt string `protobuf:"bytes,5,opt,name=timeAt,proto3" json:"timeAt,omitempty"` // 时间,格式HHII
|
||||
Bytes int64 `protobuf:"varint,6,opt,name=bytes,proto3" json:"bytes,omitempty"` // 峰值带宽字节
|
||||
TotalBytes int64 `protobuf:"varint,9,opt,name=totalBytes,proto3" json:"totalBytes,omitempty"` // 总流量
|
||||
Bits int64 `protobuf:"varint,7,opt,name=bits,proto3" json:"bits,omitempty"` // 峰值带宽比特
|
||||
NodeRegionId int64 `protobuf:"varint,8,opt,name=nodeRegionId,proto3" json:"nodeRegionId,omitempty"` // 节点所在区域ID
|
||||
}
|
||||
|
||||
func (x *ServerBandwidthStat) Reset() {
|
||||
@@ -115,6 +116,13 @@ func (x *ServerBandwidthStat) GetBytes() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ServerBandwidthStat) GetTotalBytes() int64 {
|
||||
if x != nil {
|
||||
return x.TotalBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ServerBandwidthStat) GetBits() int64 {
|
||||
if x != nil {
|
||||
return x.Bits
|
||||
@@ -134,7 +142,7 @@ var File_models_model_server_bandwidth_stat_proto protoreflect.FileDescriptor
|
||||
var file_models_model_server_bandwidth_stat_proto_rawDesc = []byte{
|
||||
0x0a, 0x28, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x5f,
|
||||
0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xd1,
|
||||
0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xf1,
|
||||
0x01, 0x0a, 0x13, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64,
|
||||
0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64,
|
||||
@@ -144,7 +152,9 @@ var file_models_model_server_bandwidth_stat_proto_rawDesc = []byte{
|
||||
0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x74, 0x69, 0x6d, 0x65, 0x41, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x69,
|
||||
0x6d, 0x65, 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x69,
|
||||
0x01, 0x28, 0x03, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f,
|
||||
0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a,
|
||||
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x69,
|
||||
0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x62, 0x69, 0x74, 0x73, 0x12, 0x22,
|
||||
0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x08,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e,
|
||||
|
||||
Reference in New Issue
Block a user