>
>
> "systemd-cgtop -n2 -b > test" is not showing cpu usage, neither
> "var=$(systemd-cgtop -n2 -b)
>
>
It seems that systemd 225 can now handle shell stdout redirection (showing
CPU usage) like "systemd-cgtop -n2 -b > test", but it is outputting every
interaction to the file. It is possible to
>
>
> I am not convinced that "bash" is the right language to do such
> calculations in.
>
You are right! But I have tried "systemd-cgtop -n 2 -b > test" and it
doesn't return CPU usage (actually I believe it just returns the first
interaction. I tried increase the number of interactions without
>
>
>
> See:
>
> https://github.com/systemd/systemd/blob/master/src/cgtop/cgtop.c#L232
>
> It simply divides the CPU time spent by the real time spent, that's all.
>
>
Any suggestion of how to get those times using bash ?
I am using "/proc/stat" for system cpu and "/sys/fs/cgroup/cpu,
Hi,
I am implementing a zabbix monitoring service for docker (some
implementations that I found are not working the way I need).
I am using a bash script for collecting container CPU % direct from cgroup
cpuacct. The bash script (at the end of this message) is very simple (I
copied the idea from