diff --git a/examples/stats.html b/examples/stats.html index c874606c..4de0311a 100644 --- a/examples/stats.html +++ b/examples/stats.html @@ -51,7 +51,7 @@ var data = await (await fetch(url.value||(location.origin+'/gun/stats.radata'), {method: 'GET',mode: 'cors'})).json(); $('#block').text(((br += (+new Date - S)/1000) / ++bt).toFixed(1)); data.over = (data.over/1000) || 15; - $('#stack').text(data.cpu.stack); + $('#stack').text((data.cpu||'').stack); $('#peers').text(data.peers.count); $('#time').text((data.peers.time / 1000 / 60).toFixed(0)); $('#nodes').text(data.node.count); diff --git a/lib/stats.js b/lib/stats.js index 161e8ca7..a8488e24 100644 --- a/lib/stats.js +++ b/lib/stats.js @@ -66,7 +66,7 @@ Gun.on('opt', function(root){ stats.over = S; stats.gap = {}; - exec("top -b -n 1", function(err, out){ out && fs.writeFile(__dirname+'/../stats.top.'+root.opt.file, out, noop) }); + exec("top -b -n 1", function(err, out){ out && fs.writeFile(__dirname+'/../stats.top.'+(root.opt.file||file), out, noop) }); }, 1000 * 15); });