Udostępnij za pośrednictwem


How to: Monitor Performance at Run Time

The .NET Compact Framework Remote Performance Monitor is an analysis tool that is included with the .NET Compact Framework version 2.0 Service Pack 1. This tool provides a user interface that lets you view performance data on the fly. When you start 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 by using the Windows desktop tool, PerfMon.exe. You can use these tools together for a live, graphical view of the performance counter data generated by the CLR.

Remote Performance Monitor enables you to do the following:

  • 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 you use this feature, 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 that were created in the .NET Compact Framework version 2.0.

  • Enable and disable logging.

Remote Performance Monitor supports Windows Embedded CE 5.0, Windows Embedded CE 6.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\version\bin. This directory contains both device and desktop files.

Note

For additional information about Remote Performance Monitor, see the readme file in Program Files\Microsoft.NET\SDK\CompactFramework\version\bin.

This topic provides the following information about using Remote Performance Monitor in the .NET Compact Framework 2.0: 

  • Setting up Remote Performance Monitor.

  • Displaying Performance Data for an Application.

  • Using PerfMon.exe with Remote Performance Monitor.

For the .NET Compact Framework 3.5 and later versions, Remote Performance Monitor and its associated documentation are included in the Power Toys for .NET Compact Framework. For more information, see Power Toys for .NET Compact Framework.

Setting up Remote Performance Monitor

You can set up Remote Performance Monitor in one of two ways:

  • Use ActiveSync.

  • Use an Ethernet connection.

To set up Remote Performance Monitor by using ActiveSync

  1. Copy Netcfrtl.dll to the \Windows directory on the device by using an ActiveSync connection.

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

  2. Ensure that files required for connectivity with Remote Performance Monitor are present on the device.

    These files are automatically copied to the device when you run the Visual Studio debugger for the first time against the application. If you are not using Visual Studio, you must copy the following files to the \Windows directory on the device: eDbgTL.dll and TcpConnectionA.dll. For the Windows SDK, these files are located in the \Program Files\Common Files\microsoft shared\CoreCon\1.0\Target\wce400\processortype folder.

To set up Remote Performance Monitor by 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 that is currently being used. This file is located in Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin.

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

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

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

  3. Ensure that files required for connectivity with Remote Performance Monitor are present on the device.

    These files are automatically copied to the device when you run the Visual Studio debugger for the first time against the application. If you are not using Visual Studio, you must copy the following files to the \Windows directory on the device: eDbgTL.dll and TcpConnectionA.dll. For the Windows SDK, these files are located in the \Program Files\Common Files\microsoft shared\CoreCon\1.0\Target\wce400\processortype folder.

Displaying Performance Data for an Application

To use Remote Performance Monitor to display performance data for an application

  1. Start Remote Performance Monitor.

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

    Note

    If you are using a version of Remote Performance Monitor that is older than the version that ships with the .NET Compact Framework 2.0 Service Pack 2, click Live Counters on the File menu after Remote Performance Monitor starts.

  2. In the Device list, type 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 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. In the Application text box, type the full path of the application.

  4. In the Parameters text box, type any command-line arguments for the application.

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

  6. Click Connect.

    Remote Performance Monitor starts the application and displays performance data.

Using PerfMon.exe

To use PerfMon.exe with Remote Performance Monitor

  1. Start Remote Performance Monitor.

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

    Note

    If you are using a version of Remote Performance Monitor that is older than the version that ships with the .NET Compact Framework 2.0 Service Pack 2, click Live Counters on the File menu after Remote Performance Monitor starts.

  2. On the Options menu, click Publish to Perfmon.

  3. Start an application from Remote Performance Monitor.

  4. Start PerfMon.exe.

    This file is located in \Windows\System32.

  5. In the left pane of PerfMon.exe, click System Monitor if it is not already selected.

  6. Right-click in the right pane, and then click Add Counters.

  7. In the Performance object list, click the category of counter that you want to graph in PerfMon.exe.

    The names of the categories correspond to the categories that appear when you view statistical data in Remote Performance Monitor. For example, the garbage collection counters are named .NET CF GC in PerfMon.exe.

  8. Click Add.

See Also

Concepts

Performance Counters in the .NET Compact Framework

Other Resources

Performance and Diagnostics in the .NET Compact Framework