mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-01-02 09:06:36 +08:00
增加API方法调用耗时统计
This commit is contained in:
30
pkg/rpc/protos/api_method_stat_service.proto
Normal file
30
pkg/rpc/protos/api_method_stat_service.proto
Normal file
@@ -0,0 +1,30 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_api_method_stat.proto";
|
||||
import "models/rpc_messages.proto";
|
||||
|
||||
// API方法统计服务
|
||||
service APIMethodStatService {
|
||||
// 查找某天的统计
|
||||
rpc findAPIMethodStatsWithDay(FindAPIMethodStatsWithDayRequest) returns (FindAPIMethodStatsWithDayResponse);
|
||||
|
||||
// 检查是否有统计数据
|
||||
rpc countAPIMethodStatsWithDay(CountAPIMethodStatsWithDayRequest) returns (RPCCountResponse);
|
||||
}
|
||||
|
||||
// 查找某天的统计
|
||||
message FindAPIMethodStatsWithDayRequest {
|
||||
string day = 1; // YYYYMMDD
|
||||
}
|
||||
|
||||
message FindAPIMethodStatsWithDayResponse {
|
||||
repeated APIMethodStat apiMethodStats = 1;
|
||||
}
|
||||
|
||||
// 检查是否有统计数据
|
||||
message CountAPIMethodStatsWithDayRequest {
|
||||
string day = 1; // YYYYMMDD
|
||||
}
|
||||
18
pkg/rpc/protos/models/model_api_method_stat.proto
Normal file
18
pkg/rpc/protos/models/model_api_method_stat.proto
Normal file
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_api_node.proto";
|
||||
|
||||
message APIMethodStat {
|
||||
int64 id = 1;
|
||||
int64 apiNodeId = 2;
|
||||
string method = 3;
|
||||
string tag = 4;
|
||||
float costMs = 5;
|
||||
float peekMs = 6;
|
||||
int64 countCalls = 7;
|
||||
|
||||
APINode apiNode = 30;
|
||||
}
|
||||
@@ -19,4 +19,6 @@ message APINode {
|
||||
bytes accessAddrsJSON = 10;
|
||||
repeated string accessAddrs = 11;
|
||||
bytes statusJSON = 12;
|
||||
|
||||
bool debug = 30;
|
||||
}
|
||||
@@ -38,6 +38,9 @@ service APINodeService {
|
||||
|
||||
// 计算使用某个SSL证书的API节点数量
|
||||
rpc countAllEnabledAPINodesWithSSLCertId (CountAllEnabledAPINodesWithSSLCertIdRequest) returns (RPCCountResponse);
|
||||
|
||||
// 修改调试模式状态
|
||||
rpc debugAPINode(DebugAPINodeRequest) returns (RPCSuccess);
|
||||
}
|
||||
|
||||
// 创建API节点
|
||||
@@ -135,3 +138,8 @@ message FindCurrentAPINodeResponse {
|
||||
message CountAllEnabledAPINodesWithSSLCertIdRequest {
|
||||
int64 sslCertId = 1;
|
||||
}
|
||||
|
||||
// 修改调试模式状态
|
||||
message DebugAPINodeRequest {
|
||||
bool debug = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user