How to: Monitor Performance at Run Time (Xbox 360)

Describes performance monitoring with the XNA Framework Remote Performance Monitor.

The XNA Framework Remote Performance Monitor is a performance analysis tool included with the XNA Framework. This tool provides a user interface that lets you view performance data at application run time. When you start your application from Remote Performance Monitor, the tool reads statistical data for the XNA Framework performance counters directly from the common language runtime (CLR).

You can also view XNA Framework performance counters using the Windows desktop tool, PerfMon.exe. Using Remote Performance Monitor in combination with PerfMon.exe gives you a live, graphical view of the performance counter data generated by the CLR.

With the Remote Performance Monitor you can:

  • View performance counter data while you run an application.

  • View performance counter data in a graphical format in PerfMon.exe while you run an application.

  • View garbage collector heap dumps. For more information, see How to: Generate a Garbage Collector Heap Dump.

  • View .stat files.

For a list of available performance counters, see Performance Counters in the XNA Framework.

Using XNA Framework Remote Performance Monitor

Note

Before you use Remote Performance Monitor, you must configure your Xbox 360 console to communicate with XNA Game Studio on your desktop computer. See Configuring XNA Game Studio and Your Xbox 360 Console.

To run an application from Remote Performance Monitor

  1. On the Xbox 360 console, start XNA Game Studio Connect, and then select Launch.

  2. On your desktop computer, click Start, point to All Programs, select Microsoft XNA Game Studio 4.0, point to Tools, and then click XNA Framework Remote Performance Monitor.

  3. Click the Launch Application icon, which is the green arrow on the toolbar.

  4. In the Device list, click the Xbox device to which you are connected. For an XNA Game Studio game, select “YourBoxName(Xbox 360)”; for an XNA Game Studio for XDK Extensions game, select “YourBoxName(Xbox 360 Dev kit)”.

  5. In the Application text box, enter the game's name. For a XNA Game Studio game, use the name of the game only (no path required); for an XNA Game Studio XDK Extensions game, use the full path to the game (e.g. xe:\XDKTest\Debug\default.xex).

    The name is set in Project | Properties | Application | Assembly Information | Title. This is the name of the game displayed in XNA Game Studio Connect.

  6. In the Arguments text box, enter any command-line arguments for the application.

  7. Verify that the application is not currently running on the device, and that the XNA Game Studio Connect screen is visible.

  8. Click OK.

    Remote Performance Monitor starts the application and displays performance data.

To use PerfMon.exe with Remote Performance Monitor

  1. On your desktop computer, click Start, point to All Programs, select Microsoft XNA Game Studio 4.0, point to Tools, and then click XNA Framework Remote Performance Monitor.

    Warning

    You must run the Report Performance Monitor as an administrator. If you do not run the tool as an administrator the the operations of the tool will fail with this set of displayed messages:

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

  3. Start an application from Remote Performance Monitor using the previous procedure.

  4. Start PerfMon.exe.

    This file is located in \Windows\System32.

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

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

  7. In the Performance Object list, select the counter group name (or expand the group and select a single counter) that you want to graph in PerfMon.exe.

    The group names correspond to the categories that appear when you view statistical data in Remote Performance Monitor. For example, the garbage collection group is called "Xbox 360 GC" in PerfMon.exe.

  8. Click Add.

To save performance data

  1. Start an application from Remote Performance Monitor.

  2. Start PerfMon.exe, and then graph performance data.

  3. On the Performance Monitor graph window, right-click, and then select Save Settings As.

  4. Type a name for the file, and specify the folder in which to save the file.

    The file is saved with a .htm extension. Use Internet Explorer or Remote Performance Monitor to open and view the generated .htm file.

See Also

Concepts

Performance Counters in the XNA Framework
How to: Generate a Garbage Collector Heap Dump