Component monitoring resource consumption through Docker API and plotting results
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
README.md
processor.png

README.md

AGILE Performance Monitor

This component monitors CPU, Netowrk and Processor usage from a set of containers throught the docker API.

Then it plots the consumption graphs over time using a wrapper of GNUPlot

To execute it, first configure the containers you want to monitor and the location of the images with the plots genearted. Make sure that the folder exists!

node src/index.js

Once you have terminated the process (Ctrl+C) the program will generate image like the following:

Processor measurmement generated by the monitor

Also you will have the data used for the plots in the /tmp/ folder of your OS with a name following this convention perf_${containername}_${containerid} like:

perf_nodered_d19f2018edd80c586e33c1f997b35569e07ede7392a91c74361a151a8eedde10

And the raw docker stats in:

perf_nodered_d19f2018edd80c586e33c1f997b35569e07ede7392a91c74361a151a8eedde10_stats

Connecting to docker sockets

The docker field of the configuration specifies how to interact with Docker APIs. So, if you want to use the local docker deamon you can use the following:

docker:{
    socketPath: '/var/run/docker.sock'
  }

If you are running docker remotely (for example after configuring your deamon to listen on 0.0.0.0 https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd) and need to monitor containers executed in another machine you can use something like this.


docker:{
    host: 'remotehost.com',
    port: 2376,
    version: 'v1.22'
}

Issue with Memory accounting on the Pi

Some Linux distros do not enable the memory cgroup, which is used by docker to do the accounting of RAM used by each container. This is a known issue when monitoring memory in some distributions:

Instructions for Debian and Ubuntu require changes for the GRUB loader. However Raspbian does not use GRUB. Luckily, someone already described how to solve this here:

https://www.raspberrypi.org/forums/viewtopic.php?t=203128

Specifically, what you need to do is to add cgroup_enable=memory cgroup_memory=1 to the line in /boot/cmdline.txt. These two should go before elevator=deadline. For example, this is the line you need in your cmdline.txt for raspbian Raspbian GNU/Linux 9.1 (stretch) -according to lsb_release.

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=df78edfd-02 rootfstype=ext4 cgroup_enable=memory cgroup_memory=1 elevator=deadline fsck.repair=yes rootwait