2020-12-11 21:39:17 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
option go_package = "./pb";
|
|
|
|
|
|
|
|
|
|
package pb;
|
|
|
|
|
|
2021-01-25 16:41:30 +08:00
|
|
|
import "models/model_server_daily_stat.proto";
|
|
|
|
|
import "models/rpc_messages.proto";
|
2020-12-11 21:39:17 +08:00
|
|
|
|
|
|
|
|
// 服务统计相关服务
|
|
|
|
|
service ServerDailyStatService {
|
|
|
|
|
// 上传统计
|
|
|
|
|
rpc uploadServerDailyStats (UploadServerDailyStatsRequest) returns (RPCSuccess);
|
2021-06-08 11:18:39 +08:00
|
|
|
|
|
|
|
|
// 按小时读取统计数据
|
2021-06-08 15:09:58 +08:00
|
|
|
rpc findLatestServerHourlyStats (FindLatestServerHourlyStatsRequest) returns (FindLatestServerHourlyStatsResponse);
|
|
|
|
|
|
|
|
|
|
// 按分钟读取统计数据
|
|
|
|
|
rpc findLatestServerMinutelyStats (FindLatestServerMinutelyStatsRequest) returns (FindLatestServerMinutelyStatsResponse);
|
|
|
|
|
|
|
|
|
|
// 按日读取统计数据
|
|
|
|
|
rpc findLatestServerDailyStats (FindLatestServerDailyStatsRequest) returns (FindLatestServerDailyStatsResponse);
|
2020-12-11 21:39:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 上传统计
|
|
|
|
|
message UploadServerDailyStatsRequest {
|
|
|
|
|
repeated ServerDailyStat stats = 1;
|
2021-07-05 11:37:10 +08:00
|
|
|
repeated DomainStat domainStats = 2;
|
|
|
|
|
|
|
|
|
|
message DomainStat {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
string domain = 2;
|
|
|
|
|
int64 bytes = 3;
|
|
|
|
|
int64 cachedBytes = 4;
|
|
|
|
|
int64 countRequests = 5;
|
|
|
|
|
int64 countCachedRequests = 6;
|
2021-07-13 15:49:34 +08:00
|
|
|
int64 countAttackRequests = 8;
|
|
|
|
|
int64 attackBytes = 9;
|
2021-07-05 11:37:10 +08:00
|
|
|
int64 createdAt = 7;
|
|
|
|
|
}
|
2020-12-11 21:39:17 +08:00
|
|
|
}
|
2021-06-08 11:18:39 +08:00
|
|
|
|
|
|
|
|
// 按小时读取统计数据
|
2021-06-08 15:09:58 +08:00
|
|
|
message FindLatestServerHourlyStatsRequest {
|
2021-06-08 11:18:39 +08:00
|
|
|
int64 serverId = 1;
|
|
|
|
|
int32 hours = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-08 15:09:58 +08:00
|
|
|
message FindLatestServerHourlyStatsResponse {
|
2021-06-08 11:18:39 +08:00
|
|
|
repeated HourlyStat stats = 1;
|
|
|
|
|
|
|
|
|
|
message HourlyStat {
|
|
|
|
|
string hour = 1;
|
|
|
|
|
int64 bytes = 2;
|
|
|
|
|
int64 cachedBytes = 3;
|
|
|
|
|
int64 countRequests = 4;
|
|
|
|
|
int64 countCachedRequests = 5;
|
|
|
|
|
}
|
2021-06-08 15:09:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 按分钟读取统计数据
|
|
|
|
|
message FindLatestServerMinutelyStatsRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
int32 minutes = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindLatestServerMinutelyStatsResponse {
|
|
|
|
|
repeated MinutelyStat stats = 1;
|
|
|
|
|
|
|
|
|
|
message MinutelyStat {
|
|
|
|
|
string minute = 1;
|
|
|
|
|
int64 bytes = 2;
|
|
|
|
|
int64 cachedBytes = 3;
|
|
|
|
|
int64 countRequests = 4;
|
|
|
|
|
int64 countCachedRequests = 5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 按日读取统计数据
|
|
|
|
|
message FindLatestServerDailyStatsRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
int32 days = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindLatestServerDailyStatsResponse {
|
|
|
|
|
repeated DailyStat stats = 1;
|
|
|
|
|
|
|
|
|
|
message DailyStat {
|
|
|
|
|
string day = 1;
|
|
|
|
|
int64 bytes = 2;
|
|
|
|
|
int64 cachedBytes = 3;
|
|
|
|
|
int64 countRequests = 4;
|
|
|
|
|
int64 countCachedRequests = 5;
|
|
|
|
|
}
|
2021-06-08 11:18:39 +08:00
|
|
|
}
|