(ctx context.Context, in *pb.EchoRequest)
| 44 | } |
| 45 | |
| 46 | func (s *server) UnaryEcho(ctx context.Context, in *pb.EchoRequest) (*pb.EchoResponse, error) { |
| 47 | // Report a sample cost for this query. |
| 48 | cmr := orca.CallMetricsRecorderFromContext(ctx) |
| 49 | if cmr == nil { |
| 50 | return nil, status.Errorf(codes.Internal, "unable to retrieve call metrics recorder (missing ORCA ServerOption?)") |
| 51 | } |
| 52 | cmr.SetRequestCost("db_queries", 10) |
| 53 | |
| 54 | return &pb.EchoResponse{Message: in.Message}, nil |
| 55 | } |
| 56 | |
| 57 | func main() { |
| 58 | flag.Parse() |
nothing calls this directly
no test coverage detected