module GRPCPrometheus::Util

Constants

ALL_CODES

Public Instance Methods

type_from_method_info(method_info) click to toggle source
# File lib/grpc_prometheus/util.rb, line 27
def type_from_method_info(method_info)
  if method_info.input.is_a?(::GRPC::RpcDesc::Stream)
    if method_info.output.is_a?(::GRPC::RpcDesc::Stream)
      'bidi_stream'
    else
      'client_stream'
    end
  else
    if method_info.output.is_a?(::GRPC::RpcDesc::Stream)
      'server_stream'
    else
      'unary'
    end
  end
end