emptyStats empties the stats once we've sent them to the GUI. We don't need them anymore here.
()
| 247 | // emptyStats empties the stats once we've sent them to the GUI. |
| 248 | // We don't need them anymore here. |
| 249 | func (s *Statistics) emptyStats() { |
| 250 | s.Lock() |
| 251 | if len(s.Events) > 0 { |
| 252 | s.Events = make([]*Event, 0) |
| 253 | } |
| 254 | s.newEvents = false |
| 255 | s.Unlock() |
| 256 | } |
| 257 | |
| 258 | // Serialize returns the collected statistics. |
| 259 | // After return the stats, the Events are emptied, to keep collecting more stats |