Dec increments the api stats counter.
(api string)
| 216 | |
| 217 | // Dec increments the api stats counter. |
| 218 | func (stats *HTTPAPIStats) Dec(api string) { |
| 219 | if stats == nil { |
| 220 | return |
| 221 | } |
| 222 | stats.Lock() |
| 223 | defer stats.Unlock() |
| 224 | if val, ok := stats.apiStats[api]; ok && val > 0 { |
| 225 | stats.apiStats[api]-- |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | // Load returns the recorded stats. |
| 230 | func (stats *HTTPAPIStats) Load() map[string]int { |
no test coverage detected