MemoryEvents describes the configuration for the global memory event emitter.
| 39 | |
| 40 | // MemoryEvents describes the configuration for the global memory event emitter. |
| 41 | type MemoryEvents struct { |
| 42 | k *kernel.Kernel |
| 43 | |
| 44 | // The period is how often to emit an event. The memory events goroutine |
| 45 | // will ensure a minimum of one event is emitted per this period, regardless |
| 46 | // how of much memory usage has changed. |
| 47 | period time.Duration |
| 48 | |
| 49 | // Writing to this channel indicates the memory goroutine should stop. |
| 50 | stop chan struct{} |
| 51 | |
| 52 | // done is used to signal when the memory event goroutine has exited. |
| 53 | done sync.WaitGroup |
| 54 | } |
| 55 | |
| 56 | // New creates a new MemoryEvents. |
| 57 | func New(k *kernel.Kernel, period time.Duration) *MemoryEvents { |
nothing calls this directly
no outgoing calls
no test coverage detected