/
t3
/
cli
Обзор
Документация
Войти
/
t3
/
cli
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
master
proto/agent.proto
84 строки
2 KB
Ivan
fix TUI metrics
09 июл 2026, 15:21
09 июл 2026, 15:21
f8d1b63
Код
Авторство
О чём код?
syntax = "proto3"; package agent; option go_package = "gitverse.ru/t3/cli/pkg/pb"; import "log.proto"; service AgentService { rpc Stream(stream AgentRequest) returns (stream AgentResponse); } message AgentRequest { oneof payload { StartRequest start = 1; StopRequest stop = 2; } } message StartRequest { string token = 1; int32 users = 2; int64 duration_ms = 3; bytes script = 4; bytes setup = 5; string run_id = 6; optional int64 think_time_ms = 7; // static sleep between iterations (ms), not set = use pacing optional int64 pacing_ms = 8; // pacing interval (ms), not set = use static think_time } message StopRequest { string run_id = 1; } message AgentResponse { oneof payload { StatusUpdate status = 1; LogEvents logs = 2; MetricsSnapshot metrics = 3; } } message StatusUpdate { string state = 1; // STARTING, RUNNING, STOPPING, STOPPED string status = 2; // status for STOPPED state: SUCCESS, FAIL string message = 3; // error message for FAIL status only string hostname = 4; // agent hostname for identification } message LogEvents { repeated LogEvent logs = 1; } message MetricsSnapshot { string hostname = 1; int64 timestamp_ms = 2; int64 active_users = 3; int64 total_iterations = 4; int64 error_iterations = 5; repeated CustomMetric custom_metrics = 6; } message CustomMetric { string name = 1; string type = 2; // "counter" | "gauge" | "histogram" MetricValue value = 3; map<string, string> tags = 4; } message MetricValue { oneof value { int64 counter = 1; double gauge = 2; HistogramData histogram = 3; } } message HistogramData { int64 count = 1; double sum = 2; double min = 3; double max = 4; repeated double values = 5; map<int32, double> quantiles = 6; // e.g. key=90 means p90, value=123.45ms }