Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let headrooms = containerNames.map(cname => ({
key: cname,
value: Math.min(slice['cgroup.memory.limit'][cname], slice['mem.physmem']['-1']) - slice['cgroup.memory.usage'][cname]
}))
return headrooms.reduce(keyValueArrayToObjectReducer, {})