Partager via


How to: Monitor Performance at Run Time 

The .NET Compact Framework Remote Performance Monitor is an analysis tool included with the .NET Compact Framework version 2.0 SP1. This tool provides a user interface that allows you to view performance data “on-the-fly.” By launching your application from Remote Performance Monitor, the tool will read statistical data for the .NET Compact Framework performance counters directly from the common language runtime (CLR).

You can also view .NET Compact Framework performance data using the Windows desktop tool, PerfMon.exe. In combination with Remote Performance Monitor, Perfmon.exe provides developers with a live, graphical view of the performance counter data generated by the CLR.

The features provided by Remote Performance Monitor include:

  • View performance counter data while an application is running.

  • View performance counter data in a graphical format in Perfmon.exe while an application is running.

  • Enable the generation of .stat files to duplicate behavior supported in earlier versions of the .NET Compact Framework. When this feature is used, any .stat file is written to disk when the application exits. For more information, see How to: Generate Performance Statistics.

  • View previously-generated .stat files created in .NET Compact Framework version 2.0.

  • Enable and disable logging.

Remote Performance Monitor supports Windows CE 5.0, Windows Mobile 5.0, Pocket PC 2003, and Smartphone 2003 devices.

Remote Performance Monitor and its associated files are located in Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin. Both device-side and desktop-side files are contained in this directory.

NoteNote

For the most current information about Remote Performance Monitor, see the readme file in the \bin directory.

To set up Remote Performance Monitor using ActiveSync

  • Copy Netcfrtl.dll to the \Windows directory on the device using ActiveSync.

    This file is located in Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin.

To set up Remote Performance Monitor using an Ethernet connection

  1. Obtain the IP address and port number for the device.

    You can obtain this information by copying Netcflaunch.exe to your device and running it. When this application runs, it displays the IP address and port number currently in use. This file is located in Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin.

    You will use the IP address and port number when running an application from Remote Performance Monitor.

  2. Copy Netcfrtl.dll to the \Windows directory on the device.

To run an application from Remote Performance Monitor

  1. Launch Remote Performance Monitor.

    This file is named NetCFrpm.exe and is located in Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin.

  2. In the Device list box, enter or select the device.

    If you are using an ActiveSync connection, select the appropriate device from the list. If you are using an Ethernet connection, type the IP address and port number in the Device list box. For example, type 128.128.0.1 6519 to use port 6519 on a device with an IP address of 128.128.0.1.

  3. Enter the full path to the application in the Application text box.

  4. Enter any command-line arguments for the application in the Parameters text box.

  5. Verify that the application is not running on the device.

  6. Click Connect.

    Remote Performance Monitor launches the application and displays performance data.

To use Perfmon.exe with Remote Performance Monitor

  1. Launch an application from Remote Performance Monitor.

  2. Launch Perfmon.exe.

    This file is located in \Windows\System32.

  3. Select the category of counter that you want to graph in Perfmon.exe.

    The names of the categories correspond to the categories that appear when viewing statistical data in Remote Performance Monitor. For example, the GC counters are named "NET CF GC" in Perfmon.exe.

  4. Click Add.

See Also

Concepts

Performance Counters in the .NET Compact Framework

Other Resources

Performance and Diagnostics