# Performance tracking/monitoring in games [closed]

Let's say I have an online game with a downloadable client / browser plugin. I want to track performance of my software and automatically send summary to the server. Let it be fps, latency, load time, physics step calc. time, whatever... I also want tools to perform data analysis: per session stats, per hardware stats, avgs, totals, diagrams, etc. So that I could see what are the real world hotspots / bottlenecks.

Is there any common out-of-the-box / SaS solution?

• Is this a "what technology should I use" question? – Trevor Powell Sep 19 '12 at 0:56
• Scaleform framework is an approved solution for UI. Is there any approved solution for my set of problems? – Vitali Kotik Sep 19 '12 at 6:24
• "Approved"? Approved by who? – Trevor Powell Sep 19 '12 at 11:50
• Let's swap "approved" with "popular". We can make it ourselves (and probably reinvent the bicycle). Or we can look for an already existing solution. – Vitali Kotik Sep 19 '12 at 12:15
• @TrevorPowell Interestingly, the Russian translation of "Approved" translates to 2 other words whose synonyms are "well-tried" or "time-tested" (I'm always fascinated by that sort of thing). – bobobobo Oct 27 '13 at 20:14

A common approach to this is to simply use any of the numerous Web statistic tracking services available, or to roll your own.

The idea is simple enough. Web tracking software simply records every "hit" to a particular URL, along with some supporting information. You can make up URLs for specific game resources or events to use for tracking things in your game. You can either use paths in the URL or query parameters to encode extra information, plus the built-in stats these services offer (like "time on site" to see how long a user is on a particular level by pinging the level URL every so often, or time of day to see when people are on your game, or what regions your game is popular in, etc.).

For example, you might player metrics by using URLs like:

http://stats.example.com/games/mygame/levels/level3/start?user=playerid
http://stats.example.com/games/mygame/levels/level3/died?user=playerid
http://stats.example.com/games/mygame/levels/level3/finished?user=playerid


You can track performance characters by posting to URLs like:

http://stats.example.com/games/mygame/levels/level3/zones/zone13/performance?avgfps=47.5&mem=145MB&tex=247MB&minfps=17.2


Building your own service for this is fairly straight forward. You need at minimum just a simple HTTP server somewhere that logs requests, and then one of the myriad of log processing scripts out there that are so popular with Web administrators.

Generating these calls is likewise quite simple using any HTTP library. If you are building in a browser, you can just use the built-in XmlHttpRequest support to generate the hits.

You can alternatively use an off-the-shelf solution, such as Google Analytics, Clicky, and so on. They are not going to make it easy to do custom processing of performance characteristics. For that, you're best off with a custom solution that collects those stats with a script and compiles them into useful reports. Also note that some solutions, like Google Analytics, are heavily geared towards Web users only; notable, they only deliver a .js file (which is hosted on their servers and you are not supposed to copy), rather than an actual REST API, because their protocol can and does change without warning. I've seen a team go through some non-trivial effort to embed a JS interpreter just to run the Google Analytics .js files in their standalone game... don't do that, it's wasted effort for a service that isn't even ideal for the target use cases.

I've been told there is an existing off-the-shelf solution for games, but I cannot for the life of me remember its name, and Google has been no help. I may have been told wrong.

Building your own really isn't hard, though. Any half-competent contracted Web programmer (which excludes 97.4% of Web programmers, as a warning) should be able to whip up a complete working solution within a week. You'll obviously want to have a clearer definition of the exact kinds of statistics and events you're looking for.