Add Client Device Stats structs in api package

This commit is contained in:
Mahmood Ali
2018-11-13 15:35:42 -05:00
parent 5af9296bb4
commit ba3fe15f7e
3 changed files with 68 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ func TestHostStats_CPU(t *testing.T) {
logger := testlog.HCLogger(t)
cwd, err := os.Getwd()
assert.Nil(err)
hs := NewHostStatsCollector(logger, cwd)
hs := NewHostStatsCollector(logger, cwd, nil)
// Collect twice so we can calculate percents we need to generate some work
// so that the cpu values change

View File

@@ -204,6 +204,10 @@ func (h *HostStatsCollector) collectDiskStats() ([]*DiskStats, error) {
}
func (h *HostStatsCollector) collectDeviceGroupStats() []*DeviceGroupStats {
if h.deviceStatsCollector == nil {
return []*DeviceGroupStats{}
}
return h.deviceStatsCollector()
}