SetCPUUtilization records a measurement for the CPU utilization metric.
(val float64)
| 195 | |
| 196 | // SetCPUUtilization records a measurement for the CPU utilization metric. |
| 197 | func (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. |
nothing calls this directly
no test coverage detected