SetQPS records a measurement for the QPS metric.
(val float64)
| 259 | |
| 260 | // SetQPS records a measurement for the QPS metric. |
| 261 | func (s *serverMetricsRecorder) SetQPS(val float64) { |
| 262 | if val < 0 { |
| 263 | if logger.V(2) { |
| 264 | logger.Infof("Ignoring QPS value out of range: %v", val) |
| 265 | } |
| 266 | return |
| 267 | } |
| 268 | smCopy := copyServerMetrics(s.state.Load()) |
| 269 | smCopy.QPS = val |
| 270 | s.state.Store(smCopy) |
| 271 | } |
| 272 | |
| 273 | // DeleteQPS deletes the relevant server metric to prevent it from being sent. |
| 274 | func (s *serverMetricsRecorder) DeleteQPS() { |
nothing calls this directly
no test coverage detected