-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental: Adds code caching for faster loading
- Loading branch information
1 parent
67c7d3c
commit 37c0824
Showing
8 changed files
with
153 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<# | ||
.SYNOPSIS | ||
Disables the experimental feature to cache all functions into a single file, | ||
allowing quicker loading times of the Icinga PowerShell Framework | ||
.DESCRIPTION | ||
Disables the experimental feature to cache all functions into a single file, | ||
allowing quicker loading times of the Icinga PowerShell Framework | ||
.FUNCTIONALITY | ||
Experimental: Disables the Icinga for Windows code caching | ||
.EXAMPLE | ||
PS>Disable-IcingaFrameworkCodeCache; | ||
.LINK | ||
https://github.com/Icinga/icinga-powershell-framework | ||
#> | ||
|
||
function Disable-IcingaFrameworkCodeCache() | ||
{ | ||
Set-IcingaPowerShellConfig -Path 'Framework.Experimental.CodeCaching' -Value $FALSE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<# | ||
.SYNOPSIS | ||
Enables the experimental feature to cache all functions into a single file, | ||
allowing quicker loading times of the Icinga PowerShell Framework | ||
.DESCRIPTION | ||
Enables the experimental feature to cache all functions into a single file, | ||
allowing quicker loading times of the Icinga PowerShell Framework | ||
.FUNCTIONALITY | ||
Experimental: Enables the Icinga for Windows code caching | ||
.EXAMPLE | ||
PS>Enable-IcingaFrameworkCodeCache; | ||
.LINK | ||
https://github.com/Icinga/icinga-powershell-framework | ||
#> | ||
|
||
function Enable-IcingaFrameworkCodeCache() | ||
{ | ||
Set-IcingaPowerShellConfig -Path 'Framework.Experimental.CodeCaching' -Value $TRUE; | ||
|
||
Write-IcingaConsoleWarning 'This is an experimental feature and might cause some side effects during usage. Please use this function with caution. Please run "Write-IcingaFrameworkCodeCache" in addition to ensure your cache is updated. This should be done after each update of the Framework in case the feature was disabled during the update run.'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<# | ||
.SYNOPSIS | ||
Fetches the current enable/disable state of the experimental feature | ||
for caching the Icinga PowerShell Framework code | ||
.DESCRIPTION | ||
Fetches the current enable/disable state of the experimental feature | ||
for caching the Icinga PowerShell Framework code | ||
.FUNCTIONALITY | ||
Experimental: Get the current code caching configuration of the | ||
Icinga PowerShell Framework | ||
.EXAMPLE | ||
PS>Get-IcingaFrameworkCodeCache; | ||
.LINK | ||
https://github.com/Icinga/icinga-powershell-framework | ||
.OUTPUTS | ||
System.Boolean | ||
#> | ||
|
||
function Get-IcingaFrameworkCodeCache() | ||
{ | ||
$CodeCaching = Get-IcingaPowerShellConfig -Path 'Framework.Experimental.CodeCaching'; | ||
|
||
if ($null -eq $CodeCaching) { | ||
return $FALSE; | ||
} | ||
|
||
return $CodeCaching; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters