From 114ceb1fc1a24544748726bd89d1273d9d3edfbe Mon Sep 17 00:00:00 2001 From: cheetah Date: Mon, 29 Mar 2021 22:20:25 +0000 Subject: [PATCH] added memory info --- config.json | 4 ++-- index.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index 295b6a4..9d1c75f 100644 --- a/config.json +++ b/config.json @@ -8,11 +8,11 @@ "connectors": { "dummy": { "enabled": true, - "duplexTimeout": 30 + "duplexTimeout": 300 }, "pocsag": { "enabled": true, - "duplexTimeout": 30 + "duplexTimeout": 300 }, "lorawan": { "enabled": true, diff --git a/index.js b/index.js index d979408..616d065 100644 --- a/index.js +++ b/index.js @@ -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) \ No newline at end of file