Skip to content

Commit

Permalink
Fixes stats calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmerfield committed Jul 30, 2021
1 parent 3151b70 commit 08f330a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/scheduler/index.js
Expand Up @@ -13,10 +13,8 @@ const fs = require("fs-extra");
const exec = require("child_process").exec;

module.exports = function () {

// Log useful system information, once per minute
schedule("* * * * *", function () {

// Print most memory-intensive processes
exec("ps -eo pmem,pcpu,comm,args | sort -k 1 -nr | head -10", function (
err,
Expand All @@ -32,7 +30,9 @@ module.exports = function () {
// This won't work on MacOS
if (err || !contents) return;

let stats = contents.split("\n").forEach((line) => {
let stats = {};

contents.split("\n").forEach((line) => {
stats[line.split(":")[0].trim()] = parseInt(line.split(":")[1].trim());
});

Expand Down

0 comments on commit 08f330a

Please sign in to comment.