2019-09-28 15:45:59 -04:00
|
|
|
function Write-IcingaPluginPerfData()
|
|
|
|
|
{
|
2021-12-09 11:42:06 -05:00
|
|
|
if ($Global:Icinga.Protected.RunAsDaemon -eq $FALSE -And $Global:Icinga.Protected.JEAContext -eq $FALSE) {
|
2024-08-19 10:13:24 -04:00
|
|
|
if ($Global:Icinga.Private.Scheduler.PerfDataWriter.Storage.Length -ne 0) {
|
|
|
|
|
Write-IcingaConsolePlain ([string]::Format('| {0}', ($Global:Icinga.Private.Scheduler.PerfDataWriter.Storage.ToString())));
|
2022-05-24 10:44:52 -04:00
|
|
|
}
|
2024-08-19 10:13:24 -04:00
|
|
|
} else {
|
|
|
|
|
$Global:Icinga.Private.Scheduler.PerformanceData = $Global:Icinga.Private.Scheduler.PerfDataWriter.Storage.ToString();
|
2019-09-28 15:45:59 -04:00
|
|
|
}
|
|
|
|
|
|
2024-08-19 10:13:24 -04:00
|
|
|
# Ensure we clear our cache after writing the data
|
|
|
|
|
$Global:Icinga.Private.Scheduler.PerfDataWriter.Cache.Clear() | Out-Null;
|
|
|
|
|
$Global:Icinga.Private.Scheduler.PerfDataWriter.Storage.Clear() | Out-Null;
|
2019-09-28 15:45:59 -04:00
|
|
|
}
|