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

Method SetCPUUtilization

orca/server_metrics.go:197–207  ·  view source on GitHub ↗

SetCPUUtilization records a measurement for the CPU utilization metric.

(val float64)

Source from the content-addressed store, hash-verified

195
196// SetCPUUtilization records a measurement for the CPU utilization metric.
197func (s *serverMetricsRecorder) SetCPUUtilization(val float64) {
198 if val < 0 {
199 if logger.V(2) {
200 logger.Infof("Ignoring CPU Utilization value out of range: %v", val)
201 }
202 return
203 }
204 smCopy := copyServerMetrics(s.state.Load())
205 smCopy.CPUUtilization = val
206 s.state.Store(smCopy)
207}
208
209// DeleteCPUUtilization deletes the relevant server metric to prevent it from
210// being sent.

Callers

nothing calls this directly

Calls 4

copyServerMetricsFunction · 0.85
VMethod · 0.65
InfofMethod · 0.65
LoadMethod · 0.45

Tested by

no test coverage detected