NewMemory returns a Memory controller given the root folder of cgroups. It may optionally accept other configuration options, such as IgnoreModules(...)
(root string, options ...func(*memoryController))
| 155 | // NewMemory returns a Memory controller given the root folder of cgroups. |
| 156 | // It may optionally accept other configuration options, such as IgnoreModules(...) |
| 157 | func NewMemory(root string, options ...func(*memoryController)) *memoryController { |
| 158 | mc := &memoryController{ |
| 159 | root: filepath.Join(root, string(Memory)), |
| 160 | ignored: map[string]struct{}{}, |
| 161 | } |
| 162 | for _, opt := range options { |
| 163 | opt(mc) |
| 164 | } |
| 165 | return mc |
| 166 | } |
| 167 | |
| 168 | // IgnoreModules configure the memory controller to not read memory metrics for some |
| 169 | // module names (e.g. passing "memsw" would avoid all the memory.memsw.* entries) |
no outgoing calls
searching dependent graphs…