Get SQL memory usage
Hi, I have been using code to get the memory and CPU usage of processes for some time.
VBScript
set objMyProcess= Sys.WaitProcess("My Process Name",0)
log.message ("CPU usage = " & objMyProcess.CPUusage)
log.message("Memory usage = " & objMyProcess.memUsage)
Now I want to be able to get the same for SQL but SQL does not appear in the Object Browser. It appears in the Task Manager under Background Processes. I believe the reason why SQL does not appear in the Object Browser is because it is actually a service (not a process).
I either need the process handle for SQL Server (SQLEXPRESS) so that I can use the same method as above or I need a similar method to get the resources used by services. Any ideas?
Thanks.
MulgraveTester wrote:
Now I want to be able to get the same for SQL but SQL does not appear in the Object Browser. It appears in the Task Manager under Background Processes. I believe the reason why SQL does not appear in the Object Browser is because it is actually a service (not a process).
If it's in Task Manager, it's in Object Browser too. Make sure the buttons to show the system processes are pressed. If the SQL Server is running as admin, make sure to run TestComplete as admin as well.