diff --git a/container/raw/handler.go b/container/raw/handler.go index a49bd51e07..650049c545 100644 --- a/container/raw/handler.go +++ b/container/raw/handler.go @@ -201,7 +201,6 @@ func (self *rawContainerHandler) GetSpec() (info.ContainerSpec, error) { } func (self *rawContainerHandler) getFsStats(stats *info.ContainerStats) error { - // Get Filesystem information only for the root cgroup. if self.name == "/" { filesystems, err := self.fsInfo.GetGlobalFsInfo() @@ -210,7 +209,10 @@ func (self *rawContainerHandler) getFsStats(stats *info.ContainerStats) error { } for _, fs := range filesystems { stats.Filesystem = append(stats.Filesystem, - info.FsStats{fs.Device, fs.Capacity, fs.Capacity - fs.Free, + info.FsStats{ + fs.Device, + fs.Capacity, + fs.Capacity - fs.Free, fs.DiskStats.ReadsCompleted, fs.DiskStats.ReadsMerged, fs.DiskStats.SectorsRead, diff --git a/pages/static/containers_js.go b/pages/static/containers_js.go index 9ffc512d87..1c36e48710 100644 --- a/pages/static/containers_js.go +++ b/pages/static/containers_js.go @@ -1750,10 +1750,13 @@ function startFileSystemUsage(elementId, machineInfo, stats) { // A map of device name to DOM elements. window.cadvisor.fsUsage.elements = {}; - var curr = stats.stats[stats.stats.length - 1]; + var cur = stats.stats[stats.stats.length - 1]; var el = $("
"); - for (var i = 0; i < curr.filesystem.length; i++) { - var data = curr.filesystem[i]; + if (!cur.filesystem) { + return; + } + for (var i = 0; i < cur.filesystem.length; i++) { + var data = cur.filesystem[i]; el.append($("
") .addClass("row col-sm-12") .append($("

")