@@ -3,6 +3,7 @@ package analyzer
33import (
44 "encoding/json"
55 "fmt"
6+ "path/filepath"
67 "strconv"
78 "strings"
89
@@ -27,15 +28,18 @@ func (a *AnalyzeHostDiskUsage) IsExcluded() (bool, error) {
2728func (a * AnalyzeHostDiskUsage ) Analyze (getCollectedFileContents func (string ) ([]byte , error )) ([]* AnalyzeResult , error ) {
2829 hostAnalyzer := a .hostAnalyzer
2930
30- key := collect .HostDiskUsageKey (hostAnalyzer .CollectorName )
31- contents , err := getCollectedFileContents (key )
31+ name := filepath .Join ("host-collectors/diskUsage" , "diskUsage.json" )
32+ if hostAnalyzer .CollectorName != "" {
33+ name = filepath .Join ("host-collectors/diskUsage" , hostAnalyzer .CollectorName + ".json" )
34+ }
35+ contents , err := getCollectedFileContents (name )
3236 if err != nil {
33- return nil , errors .Wrapf (err , "failed to get collected file %s" , key )
37+ return nil , errors .Wrapf (err , "failed to get collected file %s" , name )
3438 }
3539
3640 diskUsageInfo := collect.DiskUsageInfo {}
3741 if err := json .Unmarshal (contents , & diskUsageInfo ); err != nil {
38- return nil , errors .Wrapf (err , "failed to unmarshal disk usage info from %s" , key )
42+ return nil , errors .Wrapf (err , "failed to unmarshal disk usage info from %s" , name )
3943 }
4044
4145 result := AnalyzeResult {
0 commit comments