The event parameter wasn't actually used when processing oom events,
likely because it's only ever available for reads.
Additionally clarify flush is for eventfds, and point to where the
buffer size of 8 is coming from.
Signed-off-by: Daniel Canter <dcanter@microsoft.com>
The Collector.Collect will be the field ns'Collect's callback, which be
invoked periodically with internal lock. And Collector.Add also runs
with ns.Lock in Collector.Lock, which is easy to cause deadlock.
Goroutine X:
ns.Collect
ns.Lock
Collector.Collect
Collector.RLock
Goroutine Y:
Collector.Add
Collector.Lock
ns.Lock
We should use ns.Lock without Collector.Lock in Add.
Fix: #6772
Signed-off-by: Wei Fu <fuweid89@gmail.com>
This makes the metrics package more extensible by allowing the default name of
`container_id` to be changed by the package caller.
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>