locked
Performance Monitor Command Line Question RRS feed

  • Question

  • I’m creating a diagnostic tool for our device drivers. Our drivers have performance counters that can be monitored through the performance monitor. I would like to be able to provide a button that will launch the performance monitor with several counters already configured. I know I can save a file from the performance monitor and open it on the same system but the computer name appears to be saved in the file as well. I would like to find a way to get this to work on any system when the user clicks a button.


     

    My idea was to launch perfmon.exe and pass the counters I want on the command line. I have searched and have not found any way to do this. Does anyone know if there are any command line options to start the performance monitor with counters configured?

    Thanks,

    Monday, March 10, 2008 12:43 PM

Answers

  • You can use perfmon as ActiveX control. So it's very simple to write your own application that will display counters you want. For example - you can use your browser as follows:

     

    <html>
    <OBJECT ID="DISystemMonitor1" WIDTH="100%" HEIGHT="100%"
       CLASSID="CLSID:C4D2D8E0-D1DD-11CE-940F-008029004347">

          <PARAM NAME="_Version" VALUE="393219">
          <PARAM NAME="_ExtentX" VALUE="18256">
          <PARAM NAME="_ExtentY" VALUE="15690">
          <PARAM NAME="DisplayType" VALUE="1">
          <PARAM NAME="ReportValueType" VALUE="0">
          <PARAM NAME="MaximumScale" VALUE="100">
          <PARAM NAME="MinimumScale" VALUE="0">
          <PARAM NAME="ShowLegend" VALUE="1">
          <PARAM NAME="ShowToolbar" VALUE="1">
          <PARAM NAME="ShowScaleLabels" VALUE="1">
          <PARAM NAME="ShowHorizontalGrid" VALUE="0">
          <PARAM NAME="ShowVerticalGrid" VALUE="0">
          <PARAM NAME="ShowValueBar" VALUE="1">
          <PARAM NAME="ManualUpdate" VALUE="1">
          <PARAM NAME="Highlight" VALUE="0">
          <PARAM NAME="ReadOnly" VALUE="0">
          <PARAM NAME="MonitorDuplicateInstances" VALUE="1">
          <PARAM NAME="UpdateInterval" VALUE="1">
          <PARAM NAME="DisplayFilter" VALUE="1">
          <PARAM NAME="BackColorCtl" VALUE="-2147483633">
          <PARAM NAME="ForeColor" VALUE="0">
          <PARAM NAME="BackColor" VALUE="16777215">
          <PARAM NAME="GridColor" VALUE="8421504">
          <PARAM NAME="TimeBarColor" VALUE="255">
          <PARAM NAME="Appearance" VALUE="-1">
          <PARAM NAME="BorderStyle" VALUE="0">
          <PARAM NAME="NextCounterColor" VALUE="2">
          <PARAM NAME="NextCounterWidth" VALUE="3">
          <PARAM NAME="NextCounterLineStyle" VALUE="0">
          <PARAM NAME="GraphTitle" VALUE="">
          <PARAM NAME="YAxisLabel" VALUE="">
          <PARAM NAME="DataSourceType" VALUE="1">
          <PARAM NAME="SqlDsnName" VALUE="">
          <PARAM NAME="SqlLogSetName" VALUE="">
          <PARAM NAME="LogFileCount" VALUE="0">
          <PARAM NAME="AmbientFont" VALUE="0">
          <PARAM NAME="FontName" VALUE="Tahoma">
          <PARAM NAME="FontSize" VALUE="9.75">
          <PARAM NAME="FontItalic" VALUE="0">
          <PARAM NAME="FontUnderline" VALUE="0">
          <PARAM NAME="FontStrikethrough" VALUE="0">
          <PARAM NAME="FontWeight" VALUE="400">
          <PARAM NAME="LegendColumnWidths" VALUE="7.50750750750751E-02    7.65765765765766E-02    0.142642642642643   0.102102102102102   8.55855855855856E-02    0.243243243243243   0.114114114114114">
          <PARAM NAME="LegendSortDirection" VALUE="8061020">
          <PARAM NAME="LegendSortColumn" VALUE="0">
          <PARAM NAME="CounterCount" VALUE="3">
          <PARAM NAME="MaximumSamples" VALUE="100">
          <PARAM NAME="SampleCount" VALUE="0">

          <PARAM NAME="Counter00001.Path" VALUE="\\SKanzhelev-x64\Memory\Pages/sec">
          <PARAM NAME="Counter00001.Color" VALUE="16711680">
          <PARAM NAME="Counter00001.Width" VALUE="1">
          <PARAM NAME="Counter00001.LineStyle" VALUE="0">
          <PARAM NAME="Counter00001.ScaleFactor" VALUE="0">

          <PARAM NAME="Selected" VALUE="\\SKanzhelev-x64\Memory\Pages/sec">

    </OBJECT>
    </html>

    Wednesday, March 12, 2008 2:40 PM

All replies

  • Look at the docs for "Logman" on microsoft.com: it's a command-line utility for configuring Perfmon logging. Also try searching this forum for "logman" as it was discussed previously in at least one thread.

     

    Regards,

    Jon

    Tuesday, March 11, 2008 5:52 PM
  •  

    I searched for logman and found some information. However, I don’t see a way to launch the performance monitor from logman. I also didn’t see a way to have logman create a file that the performance monitor could open. Maybe I'm missing something. Do you have a specific example?


    I am not just trying to collect the data and save it to a file. The idea is to have the performance monitor start with the counters for our driver pre configured so the user can view the graph of the data on the screen.

    Thanks again for any help.

    • Proposed as answer by micbeg Friday, August 8, 2008 4:19 AM
    Tuesday, March 11, 2008 6:27 PM
  • You can use perfmon as ActiveX control. So it's very simple to write your own application that will display counters you want. For example - you can use your browser as follows:

     

    <html>
    <OBJECT ID="DISystemMonitor1" WIDTH="100%" HEIGHT="100%"
       CLASSID="CLSID:C4D2D8E0-D1DD-11CE-940F-008029004347">

          <PARAM NAME="_Version" VALUE="393219">
          <PARAM NAME="_ExtentX" VALUE="18256">
          <PARAM NAME="_ExtentY" VALUE="15690">
          <PARAM NAME="DisplayType" VALUE="1">
          <PARAM NAME="ReportValueType" VALUE="0">
          <PARAM NAME="MaximumScale" VALUE="100">
          <PARAM NAME="MinimumScale" VALUE="0">
          <PARAM NAME="ShowLegend" VALUE="1">
          <PARAM NAME="ShowToolbar" VALUE="1">
          <PARAM NAME="ShowScaleLabels" VALUE="1">
          <PARAM NAME="ShowHorizontalGrid" VALUE="0">
          <PARAM NAME="ShowVerticalGrid" VALUE="0">
          <PARAM NAME="ShowValueBar" VALUE="1">
          <PARAM NAME="ManualUpdate" VALUE="1">
          <PARAM NAME="Highlight" VALUE="0">
          <PARAM NAME="ReadOnly" VALUE="0">
          <PARAM NAME="MonitorDuplicateInstances" VALUE="1">
          <PARAM NAME="UpdateInterval" VALUE="1">
          <PARAM NAME="DisplayFilter" VALUE="1">
          <PARAM NAME="BackColorCtl" VALUE="-2147483633">
          <PARAM NAME="ForeColor" VALUE="0">
          <PARAM NAME="BackColor" VALUE="16777215">
          <PARAM NAME="GridColor" VALUE="8421504">
          <PARAM NAME="TimeBarColor" VALUE="255">
          <PARAM NAME="Appearance" VALUE="-1">
          <PARAM NAME="BorderStyle" VALUE="0">
          <PARAM NAME="NextCounterColor" VALUE="2">
          <PARAM NAME="NextCounterWidth" VALUE="3">
          <PARAM NAME="NextCounterLineStyle" VALUE="0">
          <PARAM NAME="GraphTitle" VALUE="">
          <PARAM NAME="YAxisLabel" VALUE="">
          <PARAM NAME="DataSourceType" VALUE="1">
          <PARAM NAME="SqlDsnName" VALUE="">
          <PARAM NAME="SqlLogSetName" VALUE="">
          <PARAM NAME="LogFileCount" VALUE="0">
          <PARAM NAME="AmbientFont" VALUE="0">
          <PARAM NAME="FontName" VALUE="Tahoma">
          <PARAM NAME="FontSize" VALUE="9.75">
          <PARAM NAME="FontItalic" VALUE="0">
          <PARAM NAME="FontUnderline" VALUE="0">
          <PARAM NAME="FontStrikethrough" VALUE="0">
          <PARAM NAME="FontWeight" VALUE="400">
          <PARAM NAME="LegendColumnWidths" VALUE="7.50750750750751E-02    7.65765765765766E-02    0.142642642642643   0.102102102102102   8.55855855855856E-02    0.243243243243243   0.114114114114114">
          <PARAM NAME="LegendSortDirection" VALUE="8061020">
          <PARAM NAME="LegendSortColumn" VALUE="0">
          <PARAM NAME="CounterCount" VALUE="3">
          <PARAM NAME="MaximumSamples" VALUE="100">
          <PARAM NAME="SampleCount" VALUE="0">

          <PARAM NAME="Counter00001.Path" VALUE="\\SKanzhelev-x64\Memory\Pages/sec">
          <PARAM NAME="Counter00001.Color" VALUE="16711680">
          <PARAM NAME="Counter00001.Width" VALUE="1">
          <PARAM NAME="Counter00001.LineStyle" VALUE="0">
          <PARAM NAME="Counter00001.ScaleFactor" VALUE="0">

          <PARAM NAME="Selected" VALUE="\\SKanzhelev-x64\Memory\Pages/sec">

    </OBJECT>
    </html>

    Wednesday, March 12, 2008 2:40 PM
  • Thanks!! That will work for me.

     

    Wednesday, March 12, 2008 3:25 PM
  • The same html format will be saved if you right click on a counter log and choose "Save Setting As". I'm looking for something similar to what you looked for. My plan is to create a counter log and save its configurations as the .htm (or .html) file. Then when the application starts, it will load that .htm configuration file to create a new log and start collecting the data. We can do this directly from the Perfmon tool by right click on Counter then choose "New Settings from...". However, I haven't been able to find the equivalent command line for this action. Do you know any way to do this?

    Thanks in advance!
    Tuesday, June 17, 2008 11:12 PM
  • Logman can  be used to create, query, start, stop and configure perfmon (all remotely, if you wish).

    Here's a good primer - http://blogs.technet.com/askperf/archive/2008/05/13/two-minute-drill-logman-exe.aspx

    According to this page you can output html - http://windowsitpro.com/article/articleid/37934/new-performance-management-tools.html



    Friday, August 8, 2008 4:40 AM