How to: Monitor Performance at Run Time
The XNA Framework Remote Performance Monitor for Xbox 360 is a performance analysis tool included with the XNA Framework.
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 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 an application is running
- View performance counter data in a graphical format in PerfMon.exe while an application is running
- View .stat files
For a list of the available performance counters, see Performance Counters in the XNA Framework.
Using XNA Framework Remote Performance Monitor for Xbox 360
Note
Before using Remote Performance Monitor, your Xbox 360 console must be configured to communicate with XNA Game Studio Express on your desktop computer. See Configuring XNA Game Studio Express and Your Xbox 360 Console.
To run an application from Remote Performance Monitor
On the Xbox 360 console, start XNA Game Launcher and then select Connect to PC.
On your desktop computer, start All Programs | Microsoft XNA Game Studio Express | Tools | XNA Framework Remote Performance Monitor for Xbox 360.
In the Device list box, select the Xbox 360 console to which you are connected.
In the Application text box, enter the application's title. The title is set in Project | Properties | Application | Assembly Information | Title, and is the game's name as displayed in the XNA Game Launcher.
In the Arguments text box, enter any command-line arguments for the application.
Verify that the application is not running on the device.
Click Launch.
Remote Performance Monitor starts the application and displays performance data.
To use PerfMon.exe with Remote Performance Monitor
Start an application from Remote Performance Monitor.
Start PerfMon.exe.
This file is located in \Windows\System32.
On the Options menu, click Publish to Perfmon.
Select the category of counter that you want to graph in PerfMon.exe.
The category names correspond to the categories that appear when you view statistical data in Remote Performance Monitor. For example, the GC counters are named "XNA GC" in PerfMon.exe.
Click Add.
To save performance data
Start an application from Remote Performance Monitor.
Start PerfMon.exe, and then graph performance data.
On the File menu, click Save.
Type a name for the file, and specify the folder in which to save the file.
The file will be saved with a .stat extension. You can use Remote Performance Monitor to open and view generated .stat files.
See Also
Concepts
Performance Counters in the XNA Framework
Configuring XNA Game Studio Express and Your Xbox 360 Console