Merge branch 'master' into courses-vhoc

This commit is contained in:
Rob 2015-12-02 12:03:55 -08:00
commit 6d4c17f724
4 changed files with 7 additions and 2 deletions

View file

@ -19,6 +19,7 @@ preventBackspace = (event) ->
if event.keyCode is 8 and not elementAcceptsKeystrokes(event.srcElement or event.target)
event.preventDefault()
else if (key.ctrl or key.command) and not key.alt and event.keyCode in ctrlDefaultPrevented
console.debug "Prevented keystroke", key
event.preventDefault()
elementAcceptsKeystrokes = (el) ->

View file

@ -119,6 +119,7 @@
"uglify-js": "^2.5.0"
},
"optionalDependencies": {
"newrelic": "^1.24.0",
"webworker-threads": "~0.5.5"
},
"license": "MIT for the code, and CC-BY for the art and music",

View file

@ -1,3 +1,5 @@
require 'newrelic' if process.env.NEW_RELIC_LICENSE_KEY?
do (setupLodash = this) ->
GLOBAL._ = require 'lodash'
_.str = require 'underscore.string'

View file

@ -25,7 +25,8 @@ exports.middleware = (req, res, next) ->
path = req.route?.path or '/*'
stat = req.method + "." + path.replace /[^A-Za-z0-9]+/g, '_'
realClient.timing stat, ms
name = req.user?._id
realClient.unique 'users', name if name
res.once 'finish', recordMetrics
res.once 'error', cleanup
@ -39,5 +40,5 @@ exports.trace = (name, callback) ->
return callback unless realClient
time = process.hrtime()
(args...) ->
realClient.timing name, ms
realClient.timing name.replace(/[^A-Za-z0-9]+/g, '_'), ms
return callback.apply(this, args)