Re: [systemd-devel] systemd-cgtop vs docker-stats

2015-12-06 Thread Tiago Alves
> > > "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

Re: [systemd-devel] systemd-cgtop vs docker-stats

2015-12-05 Thread Tiago Alves
> > > 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

Re: [systemd-devel] systemd-cgtop vs docker-stats

2015-11-27 Thread Lennart Poettering
On Fri, 27.11.15 15:10, Tiago Alves (tiagoalve...@gmail.com) wrote: > > > > > > > > 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

Re: [systemd-devel] systemd-cgtop vs docker-stats

2015-11-27 Thread Lennart Poettering
On Thu, 26.11.15 02:28, Tiago Alves (tiagoalve...@gmail.com) wrote: > 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.

Re: [systemd-devel] systemd-cgtop vs docker-stats

2015-11-27 Thread Tiago Alves
> > > > 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,

[systemd-devel] systemd-cgtop vs docker-stats

2015-11-25 Thread Tiago Alves
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