Have you ever wanted to automate the starting/stopping of performance (PERFMON) logging? Are you a command line kinda guy/gal? Then look no further!
Microsoft r Logman.exe (6.0.6000.16386)
C:\Windows\system32\logman.exe [create|query|start|stop|delete|update|import|export] [options]
create Create a new data collector.
query Query data collector properties. If no name
is given all data collectors are listed.
start Start an existing data collector and set the
begin time to manual.
stop Stop an existing data collector and set the
end time to manual.
delete Delete an existing data collector.
update Update an existing data collector's properties.
import Import a data collector set from an XML file.
export Export a data collector set to an XML file.
-? Displays context sensitive help.
-s <computer> Perform the command on specified remote system.
-config <value> Settings file containing command options.
-ets Send commands to Event Trace Sessions
directly without saving or scheduling.
I picked up the use of this particular utility during my very first lab engagement with Microsoft. A team member was using it to automate our test process - one that I've even further refined and automated over the years. Check out a previous post: Test Process Template. Ah, the memories...that was SUCH a learning experience! I highly recommend to anyone.
Anyway, once you've created your perfmon counter log its as simple as:
logman start %logname% [-s %computer%]
For example, I've got a log called 'BizTalk' in our lab environment. In my start/stop scripts its:
logman start BizTalk
The machine that is recording performance data is also the 'automation' server, so the collection is local. As one of the NANT tasks during the shutdown of the test process, it issues the stop command:
logman stop BizTalk