@@ -19,6 +19,7 @@ import (
1919 "time"
2020
2121 "perfspect/internal/cpus"
22+ "perfspect/internal/progress"
2223 "perfspect/internal/report"
2324 "perfspect/internal/script"
2425 "perfspect/internal/target"
@@ -77,7 +78,7 @@ type Metadata struct {
7778
7879// LoadMetadata - populates and returns a Metadata structure containing state of the
7980// system.
80- func LoadMetadata (myTarget target.Target , noRoot bool , noSystemSummary bool , localTempDir string ) (Metadata , error ) {
81+ func LoadMetadata (myTarget target.Target , noRoot bool , noSystemSummary bool , localTempDir string , statusUpdate progress. MultiSpinnerUpdateFunc ) (Metadata , error ) {
8182 uarch , err := myTarget .GetArchitecture ()
8283 if err != nil {
8384 return Metadata {}, fmt .Errorf ("failed to get target architecture: %v" , err )
@@ -86,11 +87,11 @@ func LoadMetadata(myTarget target.Target, noRoot bool, noSystemSummary bool, loc
8687 if err != nil {
8788 return Metadata {}, fmt .Errorf ("failed to create metadata collector: %v" , err )
8889 }
89- return collector .CollectMetadata (myTarget , noRoot , noSystemSummary , localTempDir )
90+ return collector .CollectMetadata (myTarget , noRoot , noSystemSummary , localTempDir , statusUpdate )
9091}
9192
9293type MetadataCollector interface {
93- CollectMetadata (myTarget target.Target , noRoot bool , noSystemSummary bool , localTempDir string ) (Metadata , error )
94+ CollectMetadata (myTarget target.Target , noRoot bool , noSystemSummary bool , localTempDir string , statusUpdate progress. MultiSpinnerUpdateFunc ) (Metadata , error )
9495}
9596
9697func NewMetadataCollector (architecture string ) (MetadataCollector , error ) {
@@ -112,7 +113,7 @@ type X86MetadataCollector struct {
112113type ARMMetadataCollector struct {
113114}
114115
115- func (c * X86MetadataCollector ) CollectMetadata (myTarget target.Target , noRoot bool , noSystemSummary bool , localTempDir string ) (Metadata , error ) {
116+ func (c * X86MetadataCollector ) CollectMetadata (myTarget target.Target , noRoot bool , noSystemSummary bool , localTempDir string , statusUpdate progress. MultiSpinnerUpdateFunc ) (Metadata , error ) {
116117 var metadata Metadata
117118 var err error
118119 // Hostname
@@ -163,7 +164,7 @@ func (c *X86MetadataCollector) CollectMetadata(myTarget target.Target, noRoot bo
163164 return Metadata {}, fmt .Errorf ("failed to get metadata scripts: %v" , err )
164165 }
165166 // run the scripts
166- scriptOutputs , err := script .RunScripts (myTarget , metadataScripts , true , localTempDir , nil , "" ) // nosemgrep
167+ scriptOutputs , err := script .RunScripts (myTarget , metadataScripts , true , localTempDir , statusUpdate , "collecting metadata " ) // nosemgrep
167168 if err != nil {
168169 return Metadata {}, fmt .Errorf ("failed to run metadata scripts: %v" , err )
169170 }
@@ -282,7 +283,8 @@ func (c *X86MetadataCollector) CollectMetadata(myTarget target.Target, noRoot bo
282283 }
283284 return metadata , nil
284285}
285- func (c * ARMMetadataCollector ) CollectMetadata (myTarget target.Target , noRoot bool , noSystemSummary bool , localTempDir string ) (Metadata , error ) {
286+
287+ func (c * ARMMetadataCollector ) CollectMetadata (myTarget target.Target , noRoot bool , noSystemSummary bool , localTempDir string , statusUpdate progress.MultiSpinnerUpdateFunc ) (Metadata , error ) {
286288 var metadata Metadata
287289 // Hostname
288290 metadata .Hostname = myTarget .GetName ()
0 commit comments