Name Date Size #Lines LOC

..--

src/main/H25-Apr-2025-437302

README.mdH A D25-Apr-20251.9 KiB4534

build.gradleH A D25-Apr-20251.9 KiB6352

settings.gradleH A D25-Apr-202534 21

README.md

1gRPC ORCA Example
2================
3
4The ORCA example consists of a Hello World client and a Hello World server. Out-of-the-box the
5client behaves the same the hello-world version and the server behaves similar to the
6example-hostname. In addition, they have been integrated with backend metrics reporting features.
7
8### Build the example
9
10Build the ORCA hello-world example client & server. From the `grpc-java/examples/examples-orca`
11directory:
12```
13$ ../gradlew installDist
14```
15
16This creates the scripts `build/install/example-orca/bin/custom-backend-metrics-client` and
17`build/install/example-orca/bin/custom-backend-metrics-server`.
18
19### Run the example
20
21To use ORCA, you have to instrument both the client and the server.
22At the client, in your own load balancer policy, you use gRPC APIs to install listeners to receive
23per-query and out-of-band metric reports.
24At the server, you add a server interceptor provided by gRPC in order to send per-query backend metrics.
25And you register a bindable service, also provided by gRPC, in order to send out-of-band backend metrics.
26Meanwhile, you update the metrics data from your own measurements.
27
28That's it! In this example, we simply put all the necessary pieces together to demonstrate the
29metrics reporting mechanism.
30
311. To start the ORCA enabled example server on its default port of 50051, run:
32```
33$ ./build/install/example-orca/bin/custom-backend-metrics-server
34```
35
362. In a different terminal window, run the ORCA enabled example client:
37```
38$ ./build/install/example-orca/bin/custom-backend-metrics-client "orca tester" 1500
39```
40The first command line argument (`orca tester`) is the name you wish to include in
41the greeting request to the server and the second argument
42(`1500`) is the time period (in milliseconds) you want to run the client before it shut downed so that it will show
43more periodic backend metrics reports. You are expected to see the metrics data printed out. Try it!
44
45