Scalingo/acadock-monitoring

/cpu is not working

servomac opened this issue · 3 comments

Hi people, nice work here! I have been playing with your API, but i'm unable to obtain data for my containers CPU usage. Memory and network usage returns correct data, but cpu is just always at 0 (while docker stats and cAdvisor show the real usage correctly).

My set up:

 docker run -v /sys/fs/cgroup:/host/cgroup:ro         -e CGROUP_DIR=/host/cgroup \
            -v /proc:/host/proc:ro                    -e PROC_DIR=/host/proc \
            -v /var/run/docker.sock:/host/docker.sock -e DOCKER_URL=unix:///host/docker.sock \
            -p 4244:4244 --privileged --pid=host \
            --name acadock -d scalingo/acadock-monitoring
$ docker --version
Docker version 1.5.0, build a8a31ef

An example of the issue:

$ docker ps | grep redis
396e7635c892        redis:3                              "/entrypoint.sh redi   28 hours ago        Up 28 hours         0.0.0.0:6379->6379/tcp   redis            
$ docker stats 396e7635c892
CONTAINER           CPU %               MEM USAGE/LIMIT       MEM %               NET I/O
396e7635c892        0.14%               3.301 MiB/3.756 GiB   0.09%               31.46 MiB/26.62 MiB
$ curl -L http://localhost:4244/containers/396e7635c892/mem
3465216
$ curl -L http://localhost:4244/containers/396e7635c892/net
{"Interface":"eth0","Received":{"Bytes":33051932,"Packets":163174,"Drop":0,"Errs":0,"Fifo":0,"Frame":0,"Compressed":0,"Multicast":0},"Transmit":{"Bytes":27964385,"Packets":169496,"Drop":0,"Errs":0,"Fifo":0,"Frame":0,"Compressed":0,"Multicast":0},"RxBps":706,"TxBps":669}
$ curl -L http://localhost:4244/containers/396e7635c892/cpu
0

And the result is always the same, 0. Even with other containers. Any hint?

+1 - Also encountering this issue, /mem and /net work fine, /cpu always returns 0.

@servomac @danlamanna got it, It will be fixed asap.

It has been fixed a while ago, my use of it:
screenshot from 2016-07-07 10-53-40