Skip to content

Commit

Permalink
changes for #282
Browse files Browse the repository at this point in the history
  • Loading branch information
VladDBA committed Nov 18, 2024
1 parent 6d55cc8 commit 584c045
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions PSBlitz.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ param(

###Internal params
#Version
$Vers = "4.4.1"
$VersDate = "2024-10-22"
$Vers = "4.5.0"
$VersDate = "2024-11-19"
$TwoMonthsFromRelease = [datetime]::ParseExact("$VersDate", 'yyyy-MM-dd', $null).AddMonths(2)
$NowDate = Get-Date
#Get script path
Expand Down Expand Up @@ -1608,6 +1608,7 @@ try {
@{Name = "Max Server Memory GB"; Expression = { $_."max_server_memory_GB" } },
@{Name = "Target Server Memory GB"; Expression = { $_."target_server_memory_GB" } },
@{Name = "Total Memory Used GB"; Expression = { $_."total_memory_used_GB" } },
@{Name = "Buffer Pool Usage GB"; Expression = { $_."buffer_pool_usage_GB" } },
@{Name = "Process physical memory low"; Expression = { $_."proc_physical_memory_low" } },
@{Name = "Process virtual memory low"; Expression = { $_."proc_virtual_memory_low" } },
@{Name = "Available Physical Memory GB"; Expression = { $_."available_physical_memory_GB" } },
Expand Down Expand Up @@ -1727,7 +1728,7 @@ $htmlTable4

#List of columns that should be returned from the data set
$DataSetCols = @("logical_cpu_cores", "physical_cpu_cores", "physical_memory_GB", "max_server_memory_GB", "target_server_memory_GB",
"total_memory_used_GB", "proc_physical_memory_low", "proc_virtual_memory_low", "available_physical_memory_GB", "os_memory_state" , "CTP", "MAXDOP")
"total_memory_used_GB", "buffer_pool_usage_GB", "proc_physical_memory_low", "proc_virtual_memory_low", "available_physical_memory_GB", "os_memory_state" , "CTP", "MAXDOP")

if ($DebugInfo) {
Write-Host " ->Writing resource info to Excel" -fore yellow
Expand Down
4 changes: 4 additions & 0 deletions Resources/GetInstanceInfo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ SELECT @SQL = CASE
+ @LineFeed
+ N'AND [counter_name] LIKE N''Total Server Memory (KB)%'') AS [total_memory_used_GB],'
+ @LineFeed
+ N'(SELECT CAST(COUNT(*) * 8/1024.0/1024.0 AS DECIMAL (15,2))'
+ @LineFeed
+ N' FROM sys.dm_os_buffer_descriptors WHERE database_id <> 32767) AS [buffer_pool_usage_GB],'
+ @LineFeed
+ N'(SELECT CASE WHEN [process_physical_memory_low] = 1 THEN ''Yes'''
+ @LineFeed
+ N'ELSE ''No'' END FROM sys.dm_os_process_memory) AS [proc_physical_memory_low],'
Expand Down
Binary file modified Resources/PSBlitzOutput.xlsx
Binary file not shown.

0 comments on commit 584c045

Please sign in to comment.