mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add free and total mem usage to info
This commit is contained in:
@@ -78,6 +78,8 @@ async function getNodeInfo() {
|
||||
arch: os.arch(),
|
||||
release: os.release(),
|
||||
load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', '),
|
||||
freemem: os.freemem(),
|
||||
totalmem: os.totalmem(),
|
||||
},
|
||||
nodebb: {
|
||||
isCluster: nconf.get('isCluster'),
|
||||
@@ -91,7 +93,8 @@ async function getNodeInfo() {
|
||||
data.process.cpuUsage.system /= 1000000;
|
||||
data.process.cpuUsage.system = data.process.cpuUsage.system.toFixed(2);
|
||||
data.process.memoryUsage.humanReadable = (data.process.memoryUsage.rss / (1024 * 1024)).toFixed(2);
|
||||
|
||||
data.os.freemem = (data.os.freemem / 1000000).toFixed(2);
|
||||
data.os.totalmem = (data.os.totalmem / 1000000).toFixed(2);
|
||||
const [stats, gitInfo] = await Promise.all([
|
||||
rooms.getLocalStats(),
|
||||
getGitInfo(),
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</td>
|
||||
<td>{info.git.branch}@<a href="https://github.com/NodeBB/NodeBB/commit/{info.git.hash}" target="_blank">{info.git.hashShort}</a></td>
|
||||
<td>{info.process.cpuUsage.user} / {info.process.cpuUsage.system}</td>
|
||||
<td>{info.process.memoryUsage.humanReadable} mb</td>
|
||||
<td>{info.process.memoryUsage.humanReadable} mb / {info.os.freemem} mb</td>
|
||||
<td>{info.os.load}</td>
|
||||
<td>{info.process.uptime}</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user