Login Enterprise Continuous Tests’ Event Viewer – Part 3

Well, the next post in this series was going to be about adding filters to the data. But, I found that, with the number of events the form returned, I wanted a way to quickly see which events were the heavy hitters and in which pod they were occuring.

Note: I know that we have a larrger environment than most LVSI customers, but I think that anyone using Continuous Tests would find this tool helpful, even if you have a single deployment.

Summary View

So, I wanted to add a DataGridView that would show the counts for each Event that occured across all 6 pods. I also wanted to break them down for each pod, so I can see if any type of event is happening in any one pod or data center.

So, the first thing was to get a list of unique events. I made use of Powershell’s Get-Unique cmdlet. I applied this against the array I already had created ($AllEvents).

$eventlist = $AllEvents.event | Sort-Object | Get-Unique

Then, it was a matter of iterating through the list of events and create a new array for each count that I wanted to derive, ie, AllPods, Pod1, Pod2, etc. Then write each value to the proper column in the new DataGridView object.

ForEach ($eventitem in $eventlist) {
    
    $EventAllPods = $allevents | Where-Object Event -eq $EventItem
    $EventPod1 = $Events1 | Where-Object Event -eq $EventItem
    $EventPod2 = $Events2 | Where-Object Event -eq $EventItem
    $EventPod3 = $Events3 | Where-Object Event -eq $EventItem
    $EventPod4 = $Events4 | Where-Object Event -eq $EventItem
    $EventPodG = $EventsG | Where-Object Event -eq $EventItem
    $EventPodV = $EventsV | Where-Object Event -eq $EventItem

    [void]$dataGridView2.Rows.Add($EventItem,$EventAllPods.count,$EventPod1.count,$EventPod2.count,$EventPod3.count,$EventPod4.count,$EventPodG.count,$EventPodV.count)
}

The code for the new DataGridView object is:

$dataGridView2 = New-Object System.Windows.Forms.DataGridView

#
# dataGridView2
#
$dataGridView2.ColumnHeadersHeightSizeMode = [System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode]::AutoSize
$dataGridView2.ColumnCount = 8
$dataGridView2.ColumnHeadersVisible = $true
$dataGridView2.Columns[0].Name = "Event"
$dataGridView2.Columns[1].Name = "All Pods"
$dataGridView2.Columns[2].Name = "Pod 1"
$dataGridView2.Columns[3].Name = "Pod 2"
$dataGridView2.Columns[4].Name = "Pod 3"
$dataGridView2.Columns[5].Name = "Pod 4"
$dataGridView2.Columns[6].Name = "Pod G"
$dataGridView2.Columns[7].Name = "Pod V"
$dataGridView2.Columns[0].Width = 250
$dataGridView2.Columns[1].Width = 75
$dataGridView2.Columns[2].Width = 65
$dataGridView2.Columns[3].Width = 65
$dataGridView2.Columns[4].Width = 65
$dataGridView2.Columns[5].Width = 65
$dataGridView2.Columns[6].Width = 65
$dataGridView2.Columns[7].Width = 65
$dataGridView2.Columns[1].DefaultCellStyle.BackColor = "Yellow"

$dataGridView2.Location = New-Object System.Drawing.Point(430, 60)
$dataGridView2.Name = "dataGridView2"
$dataGridView2.RowHeadersVisible = $false
$dataGridView2.Size = New-Object System.Drawing.Size(737, 130)

Note the line that colors the All Pods column Yellow.

I did wind up moving some controls on the form around to make room for the new DataGridView. The result is this:

Side Note

Today, we updated one of the login scripts that is applied by GPO. I was able to use the LE Event Viewer to keep an eye out for any issues with the new script, particularly if the GPO took longer to apply. The Refresh button made this SO much easier! 🙂

Leave a Reply