This is read once at start of cAdvisor. We can use this to report
machine state as well as return logical name for block devices in UI.
Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)
This adds an Exists() interface to detect when the container is dead.
Before reporting an update error we check is Exists() is true.
Some documentation was added as well.
This canges the output of the Docker endpoint to be a map so that it is
more consistent from single to multiple returns. It also refactors
internally how we handle both types of requests.
Without this PR the /docker API endpoint is broken completely so this
change in format has no effect anyways.
These changes are tested by the upcoming integration tests.
Since Docker containers are known by more than one name we were
returning them once for every name they're known by. This change makes
the returned containers unique.
This is done by introducting the concept of "namespaces" of container
names. The aliases of a container are under this namespace. Namespace
names are of the form:
//<namespace>/<alias>
This allows us to (within cAdvisor) query all docker containers as
//docker regardless of whether this is a systemd or a non-systemd system.
This does break our ability to handle Docker aliases with the /container
endpoint. I think this is acceptable as our support there was not
consistent between system types.
If no resources are used by the container since the last housekeeping,
we double the housekeeping interval until --max_housekeeping_interval.
If usage was detected, we drop it back to the baseline
(--housekeeping_interval).
From my tests this reduces CPU usage in CoreOS from ~8% to ~3% with no
real loss of accuracy.
Fixes#159
The cache will now hold atlest the minimum number of stats required by the UI and more
if the buffer duration is longer than the default.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Main addition is the "subcontainers" resource which provides
ContainerInfo for all subcontainers (recursively and including
self) of the specified container.
Added Network Stats to Container Info. It still not exposed via the HTTP UI.
Bug fixes:
1. Modified docker handler to use libcontainer.GetStats instead of quering the fs package.
2. cAdvisor will not stall if any of its core operations fail.
3. cAdvisor will safely ignore any inactive or leaked docker containers. When containers are leaked cgroup state exists but docker is not aware of them.
This allows a ContainerHandlerFactory to register a CanHandle() function
which is called to determine whether the factory can handle a particular
container.
This commit disables being able to run cAdvisor without lmctfy. This
should be enabled again with a "no-op" global factory which I would like
to do in a separate PR.