This is a quick little post. LVSI has promoted the recently added function for gathering Session Metrics (CPU & Mem). This is exciting since it reduces the effort required to align data from traditional stack monitoring with the Login Enterprise test metrics.
At Rightworks, we have been waiting to turn on this function for a number of reasons, primarily being our 1.6 Terabyte SQL database in our largest environment. But, we are testing it out in our smaller environment (122 Continuous Tests). This will allow us to validate the usefulness of this data and allow us to compare it to our stack monitoring. It will also give us an idea of how much additional data will be introduced into the database.
Bring that we are still running 5.5.2, I didn’t see a way to use the API to enable Session Metrics on all 122 tests programmatically. So, I again turned to doing so with a SQL query. (I’m rather proud of how comfortable I’m becoming with SQL 😊).
So, if you are looking to do this in bulk, as well, the SQL query is pretty simple.
For Continuous Tests, use:
Update Environments.Schedules
Set SessionMetricsEnabled = 1
For Load Tests, use:
Update LoadTests.Schedule
Set SessionMetricsEnabled = 1
A simple Powershell script to run this query is:
$SQLServer = "SQLServerl"
$db1 = "LoginEnterprise"
$username = "<username>"
$password = "<password>"
$qcd = "Update Environments.Schedules
Set SessionMetricsEnabled = 1"
$events = Invoke-Sqlcmd -ServerInstance $SQLServer -Database $db1 -Query $qcd -Username $username -Password $password -Verbose
I hope this is useful to at least one person.
NOTE: I did update my personal lab to 5.6.3 today and the API does not have a property to update the tests to enable Session Metrics.