Browse Source
simple page performance logging
fix-133-memory-crash
Dan Janosik
6 years ago
No known key found for this signature in database
GPG Key ID: C6F8CE9FFDB2CED2
1 changed files with
3 additions and
0 deletions
-
app.js
|
|
@ -19,6 +19,7 @@ var debug = require("debug"); |
|
|
|
debug.enable(process.env.DEBUG); |
|
|
|
|
|
|
|
var debugLog = debug("btcexp:app"); |
|
|
|
var debugPerfLog = debug("btcexp:actionPerformace"); |
|
|
|
|
|
|
|
var express = require('express'); |
|
|
|
var favicon = require('serve-favicon'); |
|
|
@ -533,6 +534,8 @@ app.use(function(req, res, next) { |
|
|
|
var time = Date.now() - req.startTime; |
|
|
|
var memdiff = process.memoryUsage().heapUsed - req.startMem; |
|
|
|
|
|
|
|
debugPerfLog("Finished action '%s' in %d ms", req.path, time); |
|
|
|
|
|
|
|
if (global.influxdb) { |
|
|
|
var points = []; |
|
|
|
points.push({ |
|
|
|