Forum Discussion
Sebastian,
How do I learn about using the WMI service in this manner? How/where do I learn how to use and what to access in the perfmon process?
I suggest using the MSDN Library. Here are a few links I found yesterday:
WMI Tasks: Performance Monitoring
Performance Libraries and WMI
Accessing Performance Data in Script
Win32_PerfFormattedData_PerfProc_Process class
WMI Performance Counter Types
WMI Reference
One more way to explore COM interfaces is to set a breakpoint in your script and when TestComplete stops on this breakpoint, press Ctrl+F7 to invoke the Evaluation dialog. In the dialog, enter the variable name that stores reference to the desired object, click Evaluate, then click Inspect. You will see a window listing properties and methods of the selected object.
if it's possible to just start perfmon from withing TC in this manner, and then let perfmon do its thing and log data in a way that I tell it do, instead of me collecting data into variables inside the script.
Sebastian, I cannot say for sure, I'm not a perfmon guru, sorry :-) I sought for information about this and failed to find anything. I think, collecting variables in scripts is possible if you use a rather large timeout for your timers (say, 3-5 seconds).
I looked at the perfmon help and I think, I found a simpler solution. You can set up the needed monitoring settings visually and start/stop the monitoring from the command line. Here is the full recipe:
* Start perfmon.
* In the tree on the left, there is a Performance Logs and Alerts | Counter Logs item. Right-click it and select New Log Settings from the context menu.
* In the subsequent dialog, specify the name of the new log, say MyTestCounters. Click OK.
* This will display a dialog where you can specify the monitoring settings:
- On the General tab you specify --
- The file name to which perfmon will save data.
- The counters to be monitored.
- The update interval.
- On the Log Files tab you can specify the file type (comma-separated values, tab-separated or others).
Perhaps, it's a good idea to select either the comma-separated or tab-separated format as
then you will be able to process these files with Excel or some other program.
- On the Schedule tab specify how you want the monitoring to be started and stopped. Select manual start and stop.
* After you created a new log, you can command perfmon to start monitoring by executing the following command line:
logman start "MyTestCounters"
To stop monitoring tasks, use --
logman stop "MyTestCounters"
Related Content
- 7 years ago
- 14 years ago
- 6 years ago
Recent Discussions
- 14 hours ago