One gRPC service per domain in state.v1 (tasks, executions, accounts, identities, packages, captures, bindings, access, orgs, alerts and so on), each with its own server type in staterpc. RPC and message names and numbers are unchanged.
45 lines
1.3 KiB
Protocol Buffer
45 lines
1.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package state.v1;
|
|
|
|
service StatsService {
|
|
rpc StatusCounts(StatusCountsRequest) returns (StatusCountsResponse);
|
|
rpc WorkflowStats(WorkflowStatsRequest) returns (WorkflowStatsResponse);
|
|
rpc StageStats(StageStatsRequest) returns (StageStatsResponse);
|
|
rpc TokensByDay(TokensByDayRequest) returns (TokensByDayResponse);
|
|
}
|
|
|
|
// WorkflowStat mirrors storecontract.WorkflowStat.
|
|
message WorkflowStat {
|
|
string workflow = 1;
|
|
int64 runs = 2;
|
|
int64 merged = 3;
|
|
int64 pr_open = 4;
|
|
int64 parked = 5;
|
|
int64 avg_tokens = 6;
|
|
double avg_steps = 7;
|
|
int64 total_tokens = 8;
|
|
int64 completed = 9;
|
|
}
|
|
// StageStat mirrors storecontract.StageStat.
|
|
message StageStat {
|
|
string workflow = 1;
|
|
string stage = 2;
|
|
int64 runs = 3;
|
|
int64 avg_ms = 4;
|
|
int64 errors = 5;
|
|
}
|
|
// DayTokens mirrors storecontract.DayTokens.
|
|
message DayTokens {
|
|
string day = 1;
|
|
int64 tokens = 2;
|
|
}
|
|
message StatusCountsRequest {}
|
|
message StatusCountsResponse { map<string, int64> counts = 1; }
|
|
message WorkflowStatsRequest {}
|
|
message WorkflowStatsResponse { repeated WorkflowStat stats = 1; }
|
|
message StageStatsRequest {}
|
|
message StageStatsResponse { repeated StageStat stats = 1; }
|
|
message TokensByDayRequest { int64 days = 1; }
|
|
message TokensByDayResponse { repeated DayTokens tokens = 1; }
|