Commit Graph

79 Commits

Author SHA1 Message Date
Jimmi Dyson
7e10398a50 Use proc fs to get network stats.
Reasons discussed in
https://github.com/google/cadvisor/issues/822#issuecomment-135811901 &
following.
2015-08-29 00:20:07 +01:00
Jimmi Dyson
d5fa97c998 Get network stats by switching network namespace on newer Docker
versions.

Fixes #822
2015-08-25 23:27:01 +01:00
Rohit Jnagal
a123fd72d8 Add logic to read custom metric config files from container root.
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.
2015-07-22 15:45:07 +00:00
Alex Mavrogiannis
9666c8b38f population of memory limit for the machine container 2015-07-07 14:15:38 -07:00
Victor Marmol
72df0cb098 Send data for all interfaces for raw containers 2015-06-08 09:58:47 -07:00
Victor Marmol
1f248ee956 Add inotify watches as debug information 2015-05-21 14:40:49 -07:00
Victor Marmol
392e1be9e5 Use one InotifyWatcher 2015-05-21 14:40:49 -07:00
Victor Marmol
ab032efda9 Report the last cgroup destroy event. 2015-05-21 10:11:09 -07:00
Victor Marmol
36a6e68169 Separate inotify handling into its own object.
This makes it easier to ensure the error conditions are handled well and
that we don't leak watches.

Fixes #703
2015-05-21 08:36:47 -07:00
Rohit Jnagal
5e10989a78 Add an api to support ps/top. 2015-05-12 00:06:47 +00:00
Rohit Jnagal
e43ada2e00 Add 'bytes available' to fs info.
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.
2015-05-11 19:27:40 +00:00
Rohit Jnagal
4b4312b290 Improve approximation of container creation time.
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.
2015-05-07 18:14:54 +00:00
Victor Marmol
1a1a1faa7e Update inotify dependency. 2015-05-04 10:15:21 -07:00
Rohit Jnagal
d0424eca0f Add --docker_only flag to enable tracking for only docker containers and root.
This reduces unnecessary load on the system and also cleans up the UI clutter.
Currently defaulted to false.
2015-04-30 23:34:44 +00:00
Victor Marmol
64c0d3d8c3 Migrating cAdvisor to new libcontainer.
Backwards compatability is maintained with older versions of
libcontainer.
2015-04-10 14:51:29 -07:00
Rohit Jnagal
a0a419614f Add /storage endpoint to 2.0 API.
/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.
2015-03-11 01:49:58 +00:00
Rohit Jnagal
872546ba3a Bulk move current info api to info/v1. Making room for info/v2. 2015-03-04 00:47:28 +00:00
Rohit Jnagal
e09f9684e6 Fix cpuset returned in spec on a single core machine.
Switch from "0-0" to "0".
2015-02-19 18:54:23 +00:00
Victor Marmol
45ba276ae8 Add container creation time to ContainerSpec. 2015-02-05 09:52:10 -08:00
Victor Marmol
86238d0179 Allow partial success of GetStats().
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.
2015-02-03 15:26:31 -08:00
Vishnu Kannan
aedf42ba8c Adding 'HasDiskIo' to Container Spec to indicate if diskio stats are available for a given container. 2015-01-20 05:06:57 +00:00
Rohit Jnagal
cbdd96a554 Add task load stats to containers.
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.
2015-01-16 23:25:22 +00:00
Rohit Jnagal
55fceed402 Add some more missing copyrights and script to verify copyright.
Add to travis next.
2015-01-09 19:31:25 +00:00
Victor Marmol
4e3629101d Cleanup of libcontainer state generation. 2015-01-05 13:47:35 -08:00
Vish Kannan
54834156eb Merge pull request #407 from rjnagal/diskinfo
Add network stats to root container.
2015-01-02 10:06:11 -08:00
Rohit Jnagal
aee5c36313 Fix vet errors 2015-01-01 22:41:55 +00:00
Rohit Jnagal
45334c6f71 Add network stats to root container. Provides machine-level networking stats. 2014-12-30 17:12:42 +00:00
Rohit Jnagal
275b3ed653 Don't use state.json from libcontainer to get cgroup paths.
This confuses cadvisor on systems where cadvisor doesn't see cgroup mounts at the same place as root namespace view.
2014-12-24 00:25:11 +00:00
Victor Marmol
6ad13d126b Check filesystem before accessing it in UI.
Fixes #377.
2014-12-18 16:09:50 -08:00
Victor Marmol
91c974e913 Generate CgroupPaths when not available.
This happens always for non-Docker containers and sometimes with older Docker
containers.
2014-12-15 16:57:30 -08:00
Eric Paris
b74d2c6296 update to support newest libcontainer update 2014-12-15 15:00:45 -08:00
Victor Marmol
18e9394dbc Adding runtime options docs.
Also some cleanups of other docs.
2014-12-04 09:16:30 -08:00
Victor Marmol
e3ab15417c Ignore update errors for dead containers.
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.
2014-11-22 05:31:11 +08:00
Vish Kannan
c005bc1722 Merge pull request #326 from vmarmol/integration
Register inotify watches on all cgroup hierarchies.
2014-11-21 09:11:10 -08:00
Victor Marmol
fa00344601 Register inotify watches on all cgroup hierarchies.
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.
2014-11-21 20:05:50 +08:00
Victor Marmol
fc622a4b56 Fix raw driver's setting of CPU mask.
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).
2014-11-20 06:32:54 +08:00
Abin Shahab
7133ab0f7d gofmt all files 2014-10-21 05:23:23 +00:00
Abin Shahab
48129c03d1 code review fixes 2014-10-21 05:19:24 +00:00
Abin Shahab
e8ea485a0d Gofmt all files 2014-10-19 23:39:04 +00:00
Abin Shahab
e9d6289964 Added /proc/diskstats
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).
2014-10-19 23:36:08 +00:00
Abin Shahab
6b267575ad Renamed mount and removed dead code 2014-10-17 16:26:33 +00:00
Abin Shahab
751de4a0c9 code review fixes 2014-10-16 02:55:39 +00:00
Abin Shahab
b8ed0bd0e3 Mounted partitions space usage metrics per container
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.
2014-10-15 19:01:38 +00:00
Abin Shahab
c4d663c6ab minor fixes and gofmt 2014-10-15 11:10:54 +00:00
Abin Shahab
f170df0a76 Spec consistency 2014-10-15 07:58:58 +00:00
Abin Shahab
9264114895 some more renames 2014-10-14 23:19:46 +00:00
Abin Shahab
4c740cbc54 matches with the full path of the container 2014-10-14 20:01:44 +00:00
Abin Shahab
99d2c31f4d Renamed container description types 2014-10-14 20:01:44 +00:00
Abin Shahab
07fbd1ddab Fixed formatting 2014-10-14 20:01:44 +00:00
Abin Shahab
a02b7f1620 Added network stats to raw handler
Raw handler now parses an optional json file with the network interface information, and emits network stats.
2014-10-14 20:01:44 +00:00