增加多个服务带宽、流量统计接口

This commit is contained in:
刘祥超
2022-10-03 19:26:47 +08:00
parent 010a9b61d5
commit 0d8c8064bf
12 changed files with 5800 additions and 4768 deletions

View File

@@ -19,6 +19,9 @@ service ServerBandwidthStatService {
// 获取最近N天峰值带宽
rpc findDailyServerBandwidthStats(FindDailyServerBandwidthStatsRequest) returns (FindDailyServerBandwidthStatsResponse);
// 读取日期段内的带宽数据
rpc findDailyServerBandwidthStatsBetweenDays (FindDailyServerBandwidthStatsBetweenDaysRequest) returns (FindDailyServerBandwidthStatsBetweenDaysResponse);
}
// 上传带宽统计
@@ -50,6 +53,7 @@ message FindHourlyServerBandwidthStatsResponse {
string day = 1;
int32 hour = 2;
int64 bytes = 3;
int64 bits = 4;
}
}
@@ -65,5 +69,27 @@ message FindDailyServerBandwidthStatsResponse {
message Stat {
string day = 1;
int64 bytes = 3;
int64 bits = 4;
}
}
// 读取日期段内的带宽数据
message FindDailyServerBandwidthStatsBetweenDaysRequest {
int64 userId = 1; // 用户ID和服务ID二选一
int64 serverId = 2; // 服务ID和用户ID二选一
string dayFrom = 3; // 开始日期 YYYYMMDD
string dayTo = 4; // 结束日期 YYYYMMDD
int32 percentile = 5; // 可选项百分位nth带宽位置0-100之间
}
message FindDailyServerBandwidthStatsBetweenDaysResponse {
repeated Stat stats = 1;
Stat nthStat = 2;
message Stat {
string day = 1;
string timeAt = 2;
int64 bytes = 3; // 字节/秒
int64 bits = 4; // 比特/秒
}
}