mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-03 04:09:29 -05:00
Fixes default total load on CPU provider by using the average and reports sum as a different metric
This commit is contained in:
parent
6a4b067a77
commit
97134d7721
2 changed files with 5 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
### Enhancements
|
||||
|
||||
* [#631](https://github.com/Icinga/icinga-powershell-framework/pull/631) Deduplicates `-C try { Use-Icinga ...` boilerplate by adding it to the `PowerShell Base` template and removing it from every single command
|
||||
* [#669](https://github.com/Icinga/icinga-powershell-framework/pull/669) Adds new metric to the CPU provider, allowing for distinguishing between the average total load as well as the sum of it
|
||||
* [#679](https://github.com/Icinga/icinga-powershell-framework/pull/679) Adds a new data provider for fetching process information of Windows systems, while sorting all objects based on a process name and their process id
|
||||
* [#688](https://github.com/Icinga/icinga-powershell-framework/pull/688) Adds new handling to add scheduled tasks in Windows for interacting with Icinga for Windows core functionality as well as an auto renewal task for the Icinga for Windows certificate generation
|
||||
* [#690](https://github.com/Icinga/icinga-powershell-framework/pull/690) Adds automatic renewal of the `icingaforwindows.pfx` certificate for the REST-Api daemon in case the certificate is not yet present, valid or changed during the runtime of the daemon while also making the `icingaforwindows.pfx` mandatory for all installations, regardless of JEA being used or not
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ function Get-IcingaProviderDataValuesCpu()
|
|||
$CounterStructure = New-IcingaPerformanceCounterStructure -CounterCategory 'Processor Information' -PerformanceCounterHash $CpuCounter;
|
||||
[int]$TotalCpuThreads = 0;
|
||||
[decimal]$TotalCpuLoad = 0;
|
||||
[int]$SocketCount = 0;
|
||||
[hashtable]$SocketList = @{ };
|
||||
|
||||
foreach ($core in $CounterStructure.Keys) {
|
||||
|
|
@ -51,13 +52,15 @@ function Get-IcingaProviderDataValuesCpu()
|
|||
$SocketList[$entry].TotalLoad = $SocketList[$entry].TotalLoad / $SocketList[$entry].ThreadCount;
|
||||
$TotalCpuLoad += $SocketList[$entry].TotalLoad;
|
||||
$TotalCpuThreads += $SocketList[$entry].ThreadCount;
|
||||
$SocketCount += 1;
|
||||
|
||||
$CpuData.Metadata.Sockets | Add-Member -MemberType NoteProperty -Name $entry -Value (New-Object PSCustomObject);
|
||||
$CpuData.Metadata.Sockets.$entry | Add-Member -MemberType NoteProperty -Name 'Threads' -Value $SocketList[$entry].ThreadCount;
|
||||
$CpuData.Metrics.$entry | Add-Member -MemberType NoteProperty -Name 'Total' -Value $SocketList[$entry].TotalLoad;
|
||||
}
|
||||
|
||||
$CpuData.Metadata | Add-Member -MemberType NoteProperty -Name 'TotalLoad' -Value $TotalCpuLoad;
|
||||
$CpuData.Metadata | Add-Member -MemberType NoteProperty -Name 'TotalLoad' -Value ($TotalCpuLoad / $SocketCount);
|
||||
$CpuData.Metadata | Add-Member -MemberType NoteProperty -Name 'TotalLoadSum' -Value $TotalCpuLoad;
|
||||
$CpuData.Metadata | Add-Member -MemberType NoteProperty -Name 'TotalThreads' -Value $TotalCpuThreads;
|
||||
$CpuData.Metadata | Add-Member -MemberType NoteProperty -Name 'CoreDigits' -Value ([string]$TotalCpuThreads).Length;
|
||||
$CpuData.Metadata | Add-Member -MemberType NoteProperty -Name 'CoreDetails' -Value (New-Object PSCustomObject);
|
||||
|
|
|
|||
Loading…
Reference in a new issue