mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-08 03:26:35 +00:00
perf: pre-allocate slices
Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
@@ -163,11 +163,12 @@ func (c *Collectors) SetPerfCounterQuery() error {
|
||||
var (
|
||||
err error
|
||||
|
||||
perfCounterDependencies []string
|
||||
perfCounterNames []string
|
||||
perfIndicies []string
|
||||
perfCounterNames []string
|
||||
perfIndicies []string
|
||||
)
|
||||
|
||||
perfCounterDependencies := make([]string, 0, len(c.collectors))
|
||||
|
||||
for _, collector := range c.collectors {
|
||||
perfCounterNames, err = collector.GetPerfCounter()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user