Merge "debian: exclude unused cgroup directores from collectd plugins"

This commit is contained in:
Zuul 2022-06-15 21:22:35 +00:00 committed by Gerrit Code Review
commit b3c3cc8810
2 changed files with 4 additions and 0 deletions

View File

@ -198,6 +198,8 @@ def get_cpuacct():
# (e.g., docker, k8s-infra, user.slice, system.slice, machine.slice)
dir_list = next(os.walk(CPUACCT))[1]
for name in dir_list:
if any(name.endswith(x) for x in ['.mount', '.scope']):
continue
cg_path = '/'.join([CPUACCT, name])
acct = get_cgroup_cpuacct(cg_path)
cpuacct[pc.GROUP_FIRST][name] = acct

View File

@ -265,6 +265,8 @@ def get_platform_memory():
# (e.g., docker, k8s-infra, user.slice, system.slice, machine.slice)
dir_list = next(os.walk(MEMCONT))[1]
for name in dir_list:
if any(name.endswith(x) for x in ['.mount', '.scope']):
continue
cg_path = '/'.join([MEMCONT, name])
m = get_cgroup_memory(cg_path)
memory[pc.GROUP_FIRST][name] = m.get('rss_MiB', 0.0)