MCPcopy
hub / github.com/evilsocket/opensnitch / emptyStats

Method emptyStats

daemon/statistics/stats.go:249–256  ·  view source on GitHub ↗

emptyStats empties the stats once we've sent them to the GUI. We don't need them anymore here.

()

Source from the content-addressed store, hash-verified

247// emptyStats empties the stats once we've sent them to the GUI.
248// We don't need them anymore here.
249func (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

Callers 1

SerializeMethod · 0.95

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected