@@ -27,7 +27,7 @@ type helperStatus struct {
27
27
}
28
28
29
29
// GetSystemState - Gets system information about a self-hosted (physical/virtual) system
30
- func GetSystemState (server * state.Server , logger * util.Logger ) (system state.SystemState ) {
30
+ func GetSystemState (server * state.Server , logger * util.Logger , skipHelperRun bool ) (system state.SystemState ) {
31
31
config := server .Config
32
32
var status helperStatus
33
33
@@ -36,20 +36,22 @@ func GetSystemState(server *state.Server, logger *util.Logger) (system state.Sys
36
36
Architecture : runtime .GOARCH ,
37
37
}
38
38
39
- statusBytes , err := exec .Command ("/usr/bin/pganalyze-collector-helper" , "status" , config .DbDataDirectory ).Output ()
40
- if err != nil {
41
- server .SelfTest .MarkCollectionAspectError (state .CollectionAspectSystemStats , "error running system stats helper process: %s" , err )
42
- logger .PrintVerbose ("Selfhosted/System: Could not run helper process: %s" , err )
43
- } else {
44
- err = json .Unmarshal (statusBytes , & status )
39
+ if ! skipHelperRun {
40
+ statusBytes , err := exec .Command ("/usr/bin/pganalyze-collector-helper" , "status" , config .DbDataDirectory ).Output ()
45
41
if err != nil {
46
- server .SelfTest .MarkCollectionAspectError (state .CollectionAspectSystemStats , "error reading system stats helper output: %s" , err )
47
- logger .PrintVerbose ("Selfhosted/System: Could not unmarshal helper status: %s" , err )
48
- }
42
+ server .SelfTest .MarkCollectionAspectError (state .CollectionAspectSystemStats , "error running system stats helper process: %s" , err )
43
+ logger .PrintVerbose ("Selfhosted/System: Could not run helper process: %s" , err )
44
+ } else {
45
+ err = json .Unmarshal (statusBytes , & status )
46
+ if err != nil {
47
+ server .SelfTest .MarkCollectionAspectError (state .CollectionAspectSystemStats , "error reading system stats helper output: %s" , err )
48
+ logger .PrintVerbose ("Selfhosted/System: Could not unmarshal helper status: %s" , err )
49
+ }
49
50
50
- system .XlogUsedBytes = status .XlogUsedBytes
51
- system .Info .SelfHosted .DatabaseSystemIdentifier = status .SystemIdentifier
52
- system .Info .ClusterID = status .SystemIdentifier
51
+ system .XlogUsedBytes = status .XlogUsedBytes
52
+ system .Info .SelfHosted .DatabaseSystemIdentifier = status .SystemIdentifier
53
+ system .Info .ClusterID = status .SystemIdentifier
54
+ }
53
55
}
54
56
55
57
hostInfo , err := host .Info ()
0 commit comments