()
| 153 | } |
| 154 | |
| 155 | func newServerMetricsRecorder() *serverMetricsRecorder { |
| 156 | s := new(serverMetricsRecorder) |
| 157 | s.state.Store(&ServerMetrics{ |
| 158 | CPUUtilization: -1, |
| 159 | MemUtilization: -1, |
| 160 | AppUtilization: -1, |
| 161 | QPS: -1, |
| 162 | EPS: -1, |
| 163 | Utilization: make(map[string]float64), |
| 164 | RequestCost: make(map[string]float64), |
| 165 | NamedMetrics: make(map[string]float64), |
| 166 | }) |
| 167 | return s |
| 168 | } |
| 169 | |
| 170 | // ServerMetrics returns a copy of the current ServerMetrics. |
| 171 | func (s *serverMetricsRecorder) ServerMetrics() *ServerMetrics { |
no outgoing calls
no test coverage detected