Use script module to manage deployment of perf to target for metrics command #576
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors how the
perfbinary is managed and invoked in the metrics collection workflow. The main change is the removal of logic for extracting, locating, and pushing a customperfbinary to targets; instead, the code now assumes thatperfis available on the systemPATH. Additionally, the code for constructing and running theperfcommand has been simplified to use a string-based command rather than anexec.Cmdobject. This streamlines the codebase and reduces complexity around binary management.Refactoring of
perfbinary management and command construction:perfbinary to targets; the system now assumesperfis available on the systemPATHand uses"perf"directly in script templates and command construction. (cmd/metrics/metrics.go,cmd/metrics/perf.go,cmd/metrics/metadata.go) [1] [2] [3] [4] [5] [6]getPerfCommandfunction to return a string command instead of anexec.Cmdobject, simplifying how theperfcommand is assembled and executed. (cmd/metrics/perf.go,cmd/metrics/metrics.go) [1] [2] [3] [4]perfPathparameter, including in metadata collection and script definitions. (cmd/metrics/metadata.go,cmd/metrics/metrics.go) [1] [2] [3] [4] [5] [6] [7] [8] [9]"perf"directly in theScriptTemplatefield and added explicit dependencies onperfwhere appropriate. (cmd/metrics/metadata.go) [1] [2]perfbinary handling, such asperfPathintargetContextand theextractPerf/getPerfPathfunctions. (cmd/metrics/metrics.go,cmd/metrics/perf.go) [1] [2] [3]These changes should make the code easier to maintain and deploy, as it no longer requires managing a custom
perfbinary for each target system.