...

Package internal

import "google.golang.org/grpc/orca/internal"
Overview
Index

Overview ▾

Package internal contains orca-internal code, for testing purposes and to avoid polluting the godoc of the top-level orca package.

Constants

TrailerMetadataKey is the key in which the per-call backend metrics are transmitted.

const TrailerMetadataKey = "endpoint-load-metrics-bin"

Variables

AllowAnyMinReportingInterval prevents clamping of the MinReportingInterval configured via ServiceOptions, to a minimum of 30s.

For testing purposes only.

var AllowAnyMinReportingInterval any // func(*ServiceOptions)

DefaultBackoffFunc is used by the producer to control its backoff behavior.

For testing purposes only.

var DefaultBackoffFunc = ibackoff.DefaultExponential.Backoff

func ToLoadReport

func ToLoadReport(md metadata.MD) (*v3orcapb.OrcaLoadReport, error)

ToLoadReport unmarshals a binary encoded [ORCA LoadReport] protobuf message from md and returns the corresponding struct. The load report is expected to be stored as the value for key "endpoint-load-metrics-bin".

If no load report was found in the provided metadata, if multiple load reports are found, or if the load report found cannot be parsed, an error is returned.

[ORCA LoadReport]: (https://github.com/cncf/xds/blob/main/xds/data/orca/v3/orca_load_report.proto#L15)