您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

50 行
1.5 KiB

  1. // Copyright 2015-2016 gRPC authors.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Contains the definitions for a metrics service and the type of metrics
  15. // exposed by the service.
  16. //
  17. // Currently, 'Gauge' (i.e a metric that represents the measured value of
  18. // something at an instant of time) is the only metric type supported by the
  19. // service.
  20. syntax = "proto3";
  21. package grpc.testing;
  22. // Response message containing the gauge name and value
  23. message GaugeResponse {
  24. string name = 1;
  25. oneof value {
  26. int64 long_value = 2;
  27. double double_value = 3;
  28. string string_value = 4;
  29. }
  30. }
  31. // Request message containing the gauge name
  32. message GaugeRequest {
  33. string name = 1;
  34. }
  35. message EmptyMessage {}
  36. service MetricsService {
  37. // Returns the values of all the gauges that are currently being maintained by
  38. // the service
  39. rpc GetAllGauges(EmptyMessage) returns (stream GaugeResponse);
  40. // Returns the value of one gauge
  41. rpc GetGauge(GaugeRequest) returns (GaugeResponse);
  42. }