增加服务流量统计

This commit is contained in:
GoEdgeLab
2021-06-08 11:18:39 +08:00
parent 6bf6b1bfa0
commit 40130fcf26
4 changed files with 381 additions and 34 deletions

View File

@@ -8,5 +8,8 @@ message ServerDailyStat {
int64 serverId = 1;
int64 regionId = 2;
int64 bytes = 3;
int64 cachedBytes = 5;
int64 countRequests = 6;
int64 countCachedRequests = 7;
int64 createdAt = 4;
}

View File

@@ -10,9 +10,30 @@ import "models/rpc_messages.proto";
service ServerDailyStatService {
// 上传统计
rpc uploadServerDailyStats (UploadServerDailyStatsRequest) returns (RPCSuccess);
// 按小时读取统计数据
rpc findServerHourlyStats (FindServerHourlyStatsRequest) returns (FindServerHourlyStatsResponse);
}
// 上传统计
message UploadServerDailyStatsRequest {
repeated ServerDailyStat stats = 1;
}
// 按小时读取统计数据
message FindServerHourlyStatsRequest {
int64 serverId = 1;
int32 hours = 2;
}
message FindServerHourlyStatsResponse {
repeated HourlyStat stats = 1;
message HourlyStat {
string hour = 1;
int64 bytes = 2;
int64 cachedBytes = 3;
int64 countRequests = 4;
int64 countCachedRequests = 5;
}
}