added memory info

This commit is contained in:
cheetah 2021-03-29 22:20:25 +00:00
parent 0498591e4a
commit 114ceb1fc1
2 changed files with 10 additions and 3 deletions

View file

@ -8,11 +8,11 @@
"connectors": {
"dummy": {
"enabled": true,
"duplexTimeout": 30
"duplexTimeout": 300
},
"pocsag": {
"enabled": true,
"duplexTimeout": 30
"duplexTimeout": 300
},
"lorawan": {
"enabled": true,

View file

@ -54,5 +54,12 @@ app.get('/api/device/:id', async (req, res) => {
: types.DeviceRegistry.DeviceStates[ req.params.id ]
)
})
const memstats = () => {
const used = process.memoryUsage()
for (let key in used) {
console.log(`${key} ${Math.round(used[key] / 1024 / 1024 * 100) / 100} MB`)
}
}
memstats()
setInterval(memstats, 10e3)
app.listen(3000)