Add simulation throughput counter

This commit is contained in:
Nick Winter 2015-12-09 06:22:40 -08:00
parent 475966fde7
commit 453c5759cc

View file

@ -3,6 +3,7 @@ async = require 'async'
bayes = new (require 'bayesian-battle')()
LevelSession = require '../../levels/sessions/LevelSession'
User = require '../../users/User'
perfmon = require '../../commons/perfmon'
SIMULATOR_VERSION = 3
@ -199,6 +200,7 @@ module.exports.updateUserSimulationCounts = (reqUserID, callback) ->
incrementUserSimulationCount reqUserID, 'simulatedBy', (err) =>
if err? then return callback err
#console.log 'Incremented user simulation count!'
perfmon.client.increment 'simulations'
unless @isRandomMatch
incrementUserSimulationCount @levelSession.creator, 'simulatedFor', callback
else