49 lines
1.5 KiB
Protocol Buffer
49 lines
1.5 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;
|
|
// running and last_status describe the newest runs, so a workflow whose
|
|
// runs are older than a global task page still reports its real state.
|
|
int64 running = 10;
|
|
string last_status = 11;
|
|
}
|
|
// 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; }
|