-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing whitespace differences for ps script
- Loading branch information
1 parent
375407c
commit c1d5fe6
Showing
2 changed files
with
36 additions
and
36 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
61 changes: 31 additions & 30 deletions
61
src/ScriptBuilderTask.Tests/PowershellCodeGenerationTests.Generates.approved.ps1
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 |
---|---|---|
@@ -1,44 +1,45 @@ | ||
|
||
#requires -RunAsAdministrator | ||
Function InstallNSBPerfCounters { | ||
|
||
$category = @{Name="NServiceBus"; Description="NServiceBus statistics"} | ||
$counters = New-Object System.Diagnostics.CounterCreationDataCollection | ||
$counters.AddRange(@( | ||
New-Object System.Diagnostics.CounterCreationData "SLA violation countdown", "Seconds until the SLA for this endpoint is breached.", NumberOfItems32 | ||
New-Object System.Diagnostics.CounterCreationData "Critical Time Average", "The time it took from sending to processing the message.", AverageTimer32 | ||
New-Object System.Diagnostics.CounterCreationData "Critical Time AverageBase", "The time it took from sending to processing the message.", AverageBase | ||
New-Object System.Diagnostics.CounterCreationData "Critical Time", "The time it took from sending to processing the message.", NumberOfItems32 | ||
New-Object System.Diagnostics.CounterCreationData "Processing Time Average", "The time it took to successfully process a message.", AverageTimer32 | ||
New-Object System.Diagnostics.CounterCreationData "Processing Time AverageBase", "The time it took to successfully process a message.", AverageBase | ||
New-Object System.Diagnostics.CounterCreationData "Processing Time", "The time it took to successfully process a message.", NumberOfItems32 | ||
New-Object System.Diagnostics.CounterCreationData "# of msgs failures / sec", "The current number of failed processed messages by the transport per second.", RateOfCountsPerSecond32 | ||
New-Object System.Diagnostics.CounterCreationData "# of msgs successfully processed / sec", "The current number of messages processed successfully by the transport per second.", RateOfCountsPerSecond32 | ||
New-Object System.Diagnostics.CounterCreationData "# of msgs pulled from the input queue /sec", "The current number of messages pulled from the input queue by the transport per second.", RateOfCountsPerSecond32 | ||
New-Object System.Diagnostics.CounterCreationData "Retries", "A message has been scheduled for retry (FLR or SLR)", RateOfCountsPerSecond32 | ||
New-Object System.Diagnostics.CounterCreationData "SLA violation countdown", "Seconds until the SLA for this endpoint is breached.", NumberOfItems32 | ||
New-Object System.Diagnostics.CounterCreationData "Critical Time Average", "The time it took from sending to processing the message.", AverageTimer32 | ||
New-Object System.Diagnostics.CounterCreationData "Critical Time AverageBase", "The time it took from sending to processing the message.", AverageBase | ||
New-Object System.Diagnostics.CounterCreationData "Critical Time", "The time it took from sending to processing the message.", NumberOfItems32 | ||
New-Object System.Diagnostics.CounterCreationData "Processing Time Average", "The time it took to successfully process a message.", AverageTimer32 | ||
New-Object System.Diagnostics.CounterCreationData "Processing Time AverageBase", "The time it took to successfully process a message.", AverageBase | ||
New-Object System.Diagnostics.CounterCreationData "Processing Time", "The time it took to successfully process a message.", NumberOfItems32 | ||
New-Object System.Diagnostics.CounterCreationData "# of msgs failures / sec", "The current number of failed processed messages by the transport per second.", RateOfCountsPerSecond32 | ||
New-Object System.Diagnostics.CounterCreationData "# of msgs successfully processed / sec", "The current number of messages processed successfully by the transport per second.", RateOfCountsPerSecond32 | ||
New-Object System.Diagnostics.CounterCreationData "# of msgs pulled from the input queue /sec", "The current number of messages pulled from the input queue by the transport per second.", RateOfCountsPerSecond32 | ||
New-Object System.Diagnostics.CounterCreationData "Retries", "A message has been scheduled for retry (FLR or SLR)", RateOfCountsPerSecond32 | ||
|
||
)) | ||
|
||
if ([System.Diagnostics.PerformanceCounterCategory]::Exists($category.Name)) { | ||
foreach($counter in $counters){ | ||
$exists = [System.Diagnostics.PerformanceCounterCategory]::CounterExists($counter.CounterName, $category.Name) | ||
if (!$exists){ | ||
Write-Host "One or more counters are missing. The performance counter category will be recreated" | ||
[System.Diagnostics.PerformanceCounterCategory]::Delete($category.Name) | ||
if ([System.Diagnostics.PerformanceCounterCategory]::Exists($category.Name)) { | ||
|
||
foreach($counter in $counters){ | ||
$exists = [System.Diagnostics.PerformanceCounterCategory]::CounterExists($counter.CounterName, $category.Name) | ||
if (!$exists){ | ||
Write-Host "One or more counters are missing.The performance counter category will be recreated" | ||
[System.Diagnostics.PerformanceCounterCategory]::Delete($category.Name) | ||
|
||
break | ||
} | ||
} | ||
break | ||
} | ||
} | ||
} | ||
|
||
if (![System.Diagnostics.PerformanceCounterCategory]::Exists($category.Name)) { | ||
if (![System.Diagnostics.PerformanceCounterCategory]::Exists($category.Name)) { | ||
Write-Host "Creating the performance counter category" | ||
[void] [System.Diagnostics.PerformanceCounterCategory]::Create($category.Name, $category.Description, [System.Diagnostics.PerformanceCounterCategoryType]::MultiInstance, $counters) | ||
} | ||
else { | ||
Write-Host "No performance counters have to be created" | ||
} | ||
[void] [System.Diagnostics.PerformanceCounterCategory]::Create($category.Name, $category.Description, [System.Diagnostics.PerformanceCounterCategoryType]::MultiInstance, $counters) | ||
} | ||
else { | ||
Write-Host "No performance counters have to be created" | ||
} | ||
|
||
[System.Diagnostics.PerformanceCounter]::CloseSharedResources() | ||
} | ||
InstallNSBPerfCounters | ||
InstallNSBPerfCounters |