MCPcopy
hub / github.com/grpc/grpc-go / contextWithORCAResult

Function contextWithORCAResult

interop/orcalb.go:243–245  ·  view source on GitHub ↗

contextWithORCAResult sets a key in ctx with a pointer to an ORCA load report that is to be filled in by the "test_backend_metrics_load_balancer" LB policy's Picker's Done callback. If a per-call load report is provided from the server for the call, result will be filled with that, otherwise the mo

(ctx context.Context, result **v3orcapb.OrcaLoadReport)

Source from the content-addressed store, hash-verified

241// will be filled with that, otherwise the most recent OOB load report is used.
242// If no OOB report has been received, result is not modified.
243func contextWithORCAResult(ctx context.Context, result **v3orcapb.OrcaLoadReport) context.Context {
244 return context.WithValue(ctx, orcaCtxKey, result)
245}
246
247// orcaResultFromContext returns the ORCA load report stored in the context.
248// The LB policy uses this to communicate the load report back to the interop

Callers 7

DoORCAPerRPCTestFunction · 0.85
checkORCAMetricsFunction · 0.85
TestORCAOOBFallbackMethod · 0.85
TestEndpointUpdateMethod · 0.85
pollORCAResultFunction · 0.85

Calls 1

WithValueMethod · 0.80

Tested by 5

TestORCAOOBFallbackMethod · 0.68
TestEndpointUpdateMethod · 0.68
pollORCAResultFunction · 0.68