Skip to content

Commit

Permalink
Fix vet errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rjnagal committed Jan 1, 2015
1 parent 3836d1e commit aee5c36
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
56 changes: 28 additions & 28 deletions container/raw/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,20 @@ 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,
fs.DiskStats.ReadsCompleted,
fs.DiskStats.ReadsMerged,
fs.DiskStats.SectorsRead,
fs.DiskStats.ReadTime,
fs.DiskStats.WritesCompleted,
fs.DiskStats.WritesMerged,
fs.DiskStats.SectorsWritten,
fs.DiskStats.WriteTime,
fs.DiskStats.IoInProgress,
fs.DiskStats.IoTime,
fs.DiskStats.WeightedIoTime,
Device: fs.Device,
Limit: fs.Capacity,
Usage: fs.Capacity - fs.Free,
ReadsCompleted: fs.DiskStats.ReadsCompleted,
ReadsMerged: fs.DiskStats.ReadsMerged,
SectorsRead: fs.DiskStats.SectorsRead,
ReadTime: fs.DiskStats.ReadTime,
WritesCompleted: fs.DiskStats.WritesCompleted,
WritesMerged: fs.DiskStats.WritesMerged,
SectorsWritten: fs.DiskStats.SectorsWritten,
WriteTime: fs.DiskStats.WriteTime,
IoInProgress: fs.DiskStats.IoInProgress,
IoTime: fs.DiskStats.IoTime,
WeightedIoTime: fs.DiskStats.WeightedIoTime,
})
}
} else if len(self.externalMounts) > 0 {
Expand All @@ -239,20 +239,20 @@ 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,
fs.DiskStats.ReadsCompleted,
fs.DiskStats.ReadsMerged,
fs.DiskStats.SectorsRead,
fs.DiskStats.ReadTime,
fs.DiskStats.WritesCompleted,
fs.DiskStats.WritesMerged,
fs.DiskStats.SectorsWritten,
fs.DiskStats.WriteTime,
fs.DiskStats.IoInProgress,
fs.DiskStats.IoTime,
fs.DiskStats.WeightedIoTime,
Device: fs.Device,
Limit: fs.Capacity,
Usage: fs.Capacity - fs.Free,
ReadsCompleted: fs.DiskStats.ReadsCompleted,
ReadsMerged: fs.DiskStats.ReadsMerged,
SectorsRead: fs.DiskStats.SectorsRead,
ReadTime: fs.DiskStats.ReadTime,
WritesCompleted: fs.DiskStats.WritesCompleted,
WritesMerged: fs.DiskStats.WritesMerged,
SectorsWritten: fs.DiskStats.SectorsWritten,
WriteTime: fs.DiskStats.WriteTime,
IoInProgress: fs.DiskStats.IoInProgress,
IoTime: fs.DiskStats.IoTime,
WeightedIoTime: fs.DiskStats.WeightedIoTime,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion fs/fs.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build linux
//

// Provides Filesystem Stats
package fs

Expand Down
4 changes: 2 additions & 2 deletions fs/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func TestGetDiskStatsMap(t *testing.T) {
t.Errorf("Error calling getDiskStatMap %s", err)
}
if len(diskStatsMap) != 20 {
t.Errorf("diskStatsMap %s not valid", diskStatsMap)
t.Errorf("diskStatsMap %+v not valid", diskStatsMap)
}
keySet := map[string]string{
"/dev/sdb1": "/dev/sdb1",
Expand Down Expand Up @@ -42,7 +42,7 @@ func TestGetDiskStatsMap(t *testing.T) {
delete(keySet, device)
}
if len(keySet) != 0 {
t.Errorf("diskStatsMap %s contains illegal keys %s", diskStatsMap, keySet)
t.Errorf("diskStatsMap %+v contains illegal keys %+v", diskStatsMap, keySet)
}
}

Expand Down
2 changes: 1 addition & 1 deletion manager/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func getMachineInfo(sysFs sysfs.SysFs) (*info.MachineInfo, error) {
}

for _, fs := range filesystems {
machineInfo.Filesystems = append(machineInfo.Filesystems, info.FsInfo{fs.Device, fs.Capacity})
machineInfo.Filesystems = append(machineInfo.Filesystems, info.FsInfo{Device: fs.Device, Capacity: fs.Capacity})
}

return machineInfo, nil
Expand Down
2 changes: 1 addition & 1 deletion utils/procfs/scheddebug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ func TestSchedDebugReader(t *testing.T) {
loads, err := NewSchedulerLoadReader()
if testCase.Error != nil {
if err == nil {
t.Fatal("expected error: %v", testCase.Error)
t.Fatalf("expected error: %v", testCase.Error)
}
}
if err != nil {
Expand Down

0 comments on commit aee5c36

Please sign in to comment.