Snapshot returns a copy of the current ring, oldest first.
()
| 219 | |
| 220 | // Snapshot returns a copy of the current ring, oldest first. |
| 221 | func Snapshot() []Event { |
| 222 | mu.Lock() |
| 223 | defer mu.Unlock() |
| 224 | out := make([]Event, len(events)) |
| 225 | copy(out, events) |
| 226 | return out |
| 227 | } |
| 228 | |
| 229 | // Clear empties the ring. Called from /debug clear. |
| 230 | func Clear() { |
no outgoing calls