gRPC

Protocols

Call gRPC services straight from a .proto — unary and streaming — with loadr compiling the descriptors at runtime. No generated stubs to build or check in.

Browse all 52 demos 12 categories
Run it
$ loadr run examples/10-grpc.yaml
examples/10-grpc.yaml
# gRPC load: compile .proto files in-process (no protoc needed) or use
# server reflection, then call unary and streaming methods dynamically.
name: grpc
description: unary + server-streaming gRPC calls

scenarios:
  unary:
    executor: constant-arrival-rate
    rate: 200
    duration: 3m
    pre_allocated_vus: 30
    max_vus: 100
    flow:
      - request:
          name: say hello
          url: grpc://greeter.example.com:50051
          grpc:
            proto_files: [ protos/helloworld.proto ]
            service: helloworld.Greeter
            method: SayHello
            message: { name: "vu-${vu}" }
            metadata: { x-api-key: "${env.GRPC_API_KEY}" }
          assert:
            - { type: status, equals: 0 }       # gRPC OK
            - { type: jsonpath, expression: "$.message", exists: true }

  streaming_via_reflection:
    executor: constant-vus
    vus: 5
    duration: 3m
    flow:
      - request:
          name: stream replies
          url: grpc://greeter.example.com:50051
          grpc:
            reflection: true                    # no proto files needed
            service: helloworld.Greeter
            method: LotsOfReplies
            message: { name: "stream-${vu}" }
          checks:
            - { type: status, equals: 0 }

thresholds:
  grpc_req_duration: [ "p(95)<150" ]

View raw: examples/10-grpc.yaml

Related files: protos

What it shows

  • Reflection or .proto source
  • Unary + streaming
  • Message assertions