I’ve set up my source code repository at CodePlex. The source code I’ve written so far is a version of an XNA webblog staple: the frame rate counter component. I’m going to go about it a little differently. Starting with TehOne’s frame rate component, (and nifty activation handler base classes,) I cooked up something new.
The frame rate counter component itself is not drawable. Instead, it is exposed as a performance counter. This counter can be exposed via the Windows Performance Monitor, the Remote Performance Monitor for Xbox 360, or the other component I’ve written: a performance counter monitor.
The monitor is a drawable component that can either display an arbitrary number of arbitrary performance counters on-screen over the game. It can also send those counter’s data to a logging facility as it’s obtained. Both the text drawing and logging facilities are abstracted by interface, allowing the component to interact easily with existing infrastructures.
Notice I said arbitrary performance counters: in addition to the frame rate counter I provide, Windows itself provides many useful counters: information about the managed heap, CPU usage, and others. All of which can be monitored.
Now, the code in CodePlex is by no means final, it’s only been checked in to protect it. The unit tests haven’t even been started, nor have I even run this code yet, as I no longer have access to a system that meets the XNA minimum bar. (I situation that I’m rectifying as soon as possible. It is FxCop clean, of couse.
) I’d certainly appreciate any feedback, and watch this space or the CodePlex for the final versions, which should be coming soon.
OE