Fixes code styling for New-IcingaPerformanceCounterArray

This commit is contained in:
Christian Stein 2020-08-04 15:37:35 +02:00
parent 3e5a97d52b
commit 9ece8d805f

View file

@ -12,8 +12,8 @@
'\Memory\% Committed Bytes In Use' '\Memory\% Committed Bytes In Use'
); );
#> #>
function New-IcingaPerformanceCounterArray() function New-IcingaPerformanceCounterArray()
{ {
param( param(
[array]$CounterArray = @() [array]$CounterArray = @()
) )
@ -39,6 +39,13 @@
} }
} }
# TODO: Add a cache for our Performance Counters to only fetch them once
# for each session to speed up the loading. This cold be something like
# this:
# New-IcingaPerformanceCounterCache $CounterResult;
# Internally we could do something like this
# $global:Icinga_PerfCounterCache += $CounterResult;
# Above we initialse ever single counter and we only require a sleep once # Above we initialse ever single counter and we only require a sleep once
# in case a new, yet unknown counter was added # in case a new, yet unknown counter was added
if ($RequireSleep) { if ($RequireSleep) {
@ -68,4 +75,4 @@
} }
return $CounterResult; return $CounterResult;
} }