command.proto 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. syntax = "proto3";
  2. package v2ray.core.app.stats.command;
  3. option csharp_namespace = "V2Ray.Core.App.Stats.Command";
  4. option go_package = "github.com/v2fly/v2ray-core/v5/app/stats/command";
  5. option java_package = "com.v2ray.core.app.stats.command";
  6. option java_multiple_files = true;
  7. import "common/protoext/extensions.proto";
  8. message GetStatsRequest {
  9. // Name of the stat counter.
  10. string name = 1;
  11. // Whether or not to reset the counter to fetching its value.
  12. bool reset = 2;
  13. }
  14. message Stat {
  15. string name = 1;
  16. int64 value = 2;
  17. }
  18. message GetStatsResponse {
  19. Stat stat = 1;
  20. }
  21. message QueryStatsRequest {
  22. // Deprecated, use Patterns instead
  23. string pattern = 1;
  24. bool reset = 2;
  25. repeated string patterns = 3;
  26. bool regexp = 4;
  27. }
  28. message QueryStatsResponse {
  29. repeated Stat stat = 1;
  30. }
  31. message SysStatsRequest {}
  32. message SysStatsResponse {
  33. uint32 NumGoroutine = 1;
  34. uint32 NumGC = 2;
  35. uint64 Alloc = 3;
  36. uint64 TotalAlloc = 4;
  37. uint64 Sys = 5;
  38. uint64 Mallocs = 6;
  39. uint64 Frees = 7;
  40. uint64 LiveObjects = 8;
  41. uint64 PauseTotalNs = 9;
  42. uint32 Uptime = 10;
  43. }
  44. service StatsService {
  45. rpc GetStats(GetStatsRequest) returns (GetStatsResponse) {}
  46. rpc QueryStats(QueryStatsRequest) returns (QueryStatsResponse) {}
  47. rpc GetSysStats(SysStatsRequest) returns (SysStatsResponse) {}
  48. }
  49. message Config {
  50. option (v2ray.core.common.protoext.message_opt).type = "grpcservice";
  51. option (v2ray.core.common.protoext.message_opt).short_name = "stats";
  52. }