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

Method toLoadReportProto

orca/server_metrics.go:44–66  ·  view source on GitHub ↗

toLoadReportProto dumps sm as an OrcaLoadReport proto.

()

Source from the content-addressed store, hash-verified

42
43// toLoadReportProto dumps sm as an OrcaLoadReport proto.
44func (sm *ServerMetrics) toLoadReportProto() *v3orcapb.OrcaLoadReport {
45 ret := &v3orcapb.OrcaLoadReport{
46 Utilization: sm.Utilization,
47 RequestCost: sm.RequestCost,
48 NamedMetrics: sm.NamedMetrics,
49 }
50 if sm.CPUUtilization != -1 {
51 ret.CpuUtilization = sm.CPUUtilization
52 }
53 if sm.MemUtilization != -1 {
54 ret.MemUtilization = sm.MemUtilization
55 }
56 if sm.AppUtilization != -1 {
57 ret.ApplicationUtilization = sm.AppUtilization
58 }
59 if sm.QPS != -1 {
60 ret.RpsFractional = sm.QPS
61 }
62 if sm.EPS != -1 {
63 ret.Eps = sm.EPS
64 }
65 return ret
66}
67
68// merge merges o into sm, overwriting any values present in both.
69func (sm *ServerMetrics) merge(o *ServerMetrics) {

Callers 2

setTrailerMetadataMethod · 0.95
sendMetricsResponseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected