Skip to content

Instantly share code, notes, and snippets.

@jeffomatic
Created April 21, 2012 21:02
Show Gist options
  • Save jeffomatic/2439573 to your computer and use it in GitHub Desktop.
Save jeffomatic/2439573 to your computer and use it in GitHub Desktop.
Blog: Bloodrayne Metrics, Code: metrics usage example
void RecordLevelEndData()
{
// Grab in-game data
float fHealth = GetPlayerHealth();
unsigned nScore = GetPlayerScore();
// Get an object that sends data to the
// "performance" table
wfStat* pStat = wfMetrics::Create( "performance" );
// Add field data, using handy overloaded methods
pStat->AddField( "health", fHealth );
pStat->AddField( "score", nScore );
// Queue the data for upload.
// To prevent network overhead from interfering
// with the gameplay thread, a separate thread
// will handle JSON encoding and HTTP
// transmission.
wfMetrics::Commit( pStat );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment