|
|
@ -4,7 +4,6 @@ |
|
|
|
*/ |
|
|
|
'use strict' |
|
|
|
|
|
|
|
const heapdump = require('heapdump') |
|
|
|
const validator = require('validator') |
|
|
|
const bodyParser = require('body-parser') |
|
|
|
const errors = require('../lib/errors') |
|
|
@ -69,13 +68,6 @@ class SupportRestApi { |
|
|
|
HttpServer.sendAuthError |
|
|
|
) |
|
|
|
|
|
|
|
this.httpServer.app.get( |
|
|
|
`/${keys.prefixes.support}/dump/heap`, |
|
|
|
authMgr.checkHasAdminProfile.bind(authMgr), |
|
|
|
this.getHeapDump.bind(this), |
|
|
|
HttpServer.sendAuthError |
|
|
|
) |
|
|
|
|
|
|
|
this.httpServer.app.get( |
|
|
|
`/${keys.prefixes.support}/pairing`, |
|
|
|
authMgr.checkHasAdminProfile.bind(authMgr), |
|
|
@ -283,27 +275,6 @@ class SupportRestApi { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Get a dump of the heap |
|
|
|
* and store it on the filesystem |
|
|
|
*/ |
|
|
|
async getHeapDump(req, res) { |
|
|
|
try { |
|
|
|
heapdump.writeSnapshot(function(err, filename) { |
|
|
|
Logger.info(`Dump written to ${filename}`) |
|
|
|
}) |
|
|
|
HttpServer.sendOk(res) |
|
|
|
} catch(e) { |
|
|
|
const ret = { |
|
|
|
status: 'error' |
|
|
|
} |
|
|
|
Logger.error(e, 'SupportRestApi.getHeapDump() : Support head dump error') |
|
|
|
HttpServer.sendError(res, JSON.stringify(ret, null, 2)) |
|
|
|
} finally { |
|
|
|
debugApi && Logger.info(`Completed GET /dump/heap`) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Get pairing info |
|
|
|
*/ |
|
|
|