Docker does not provide the rootfs path through docker inspect or statefile
and the path is dependent on the storage driver being used.
Instead of enumerating the storage drivers, we pick a pid from the container
and get the config from /proc/pid/root. Although a bit expensive, this method
works for non-docker containers too.
The current capacity and usage numbers are insufficient to figure out
actual bytes available for a non-root user for the fs. Available is the
value used by df and the one we need to track to detect low diskspace
condition.
Containers with subcontainers always report creation time to be same as the time
of creation of the latest subcontainer.
Still not an ideal solution, but accurate for most practical purposes.
/storage returns {device, mountpoint, capacity, usage} for all filesystems.
In addition, it also detect and applies label for each filesystem - currently two - "root", "docker-images".
/storage/<label> returns info about the filesystem with specific label. eg. /storage/root returns info for root filesystem.
This should make us more robust in the face of failure (at the cost of
making the failures less prominent). We allow GetStats() to return an
error and a partial result. We will process the result and report the
error.
Fixes#306.
The stats are only populated when cAdvisor is running outside network namespaces.
We'll add a different backend to retrieve the same data from within namespaces.
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.
We used to only register them on the first hierarchy that was created (I
think this was unintentional). This caused some weird edgecases where
we'd try to delete a watch event we didn't create. It is an error we
ignore today (since we fix it in < 60s) but delays our destruction of
the container.
We used to include it with the trailing "\n" which gave us parsing
errors in the UI (and the reason why they didn't show up in any of those
containers).
Read disk io information from /proc/diskstats.
This will allow the user who provides partition container hints to get partition-specific io (blkio provides io for the container, but at the disk device level).
This computes the space usage for mounted partitions. It takes in a list of mounted partitions from containerHints
and computes the device's disk usage(so each mount must be a separate partition). This is useful for users who
mount partitions on containers and store most of the container's persistent data on those partitions.