summaryrefslogtreecommitdiff
path: root/pkg/cgroups/blkio.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/cgroups/blkio.go')
-rw-r--r--pkg/cgroups/blkio.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/cgroups/blkio.go b/pkg/cgroups/blkio.go
index 8434703fd..8eb54abec 100644
--- a/pkg/cgroups/blkio.go
+++ b/pkg/cgroups/blkio.go
@@ -59,8 +59,6 @@ func (c *blkioHandler) Stat(ctr *CgroupControl, m *Metrics) error {
}
defer f.Close()
- var ioServiceBytesRecursive []BlkIOEntry
-
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line := scanner.Text()
@@ -95,6 +93,9 @@ func (c *blkioHandler) Stat(ctr *CgroupControl, m *Metrics) error {
}
ioServiceBytesRecursive = append(ioServiceBytesRecursive, entry)
}
+ if err := scanner.Err(); err != nil {
+ return err
+ }
m.Blkio = BlkioMetrics{IoServiceBytesRecursive: ioServiceBytesRecursive}
return nil
}