From 2a104d7459caa6a79d09d33049377f0a91b9b79a Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 20 Mar 2020 18:39:26 -0500 Subject: [PATCH] added ram stats --- src/onionrstatistics/serializeddata.py | 1 + static-data/www/private/index.html | 4 ++++ static-data/www/shared/main/stats.js | 1 + 3 files changed, 6 insertions(+) diff --git a/src/onionrstatistics/serializeddata.py b/src/onionrstatistics/serializeddata.py index 2d03ed77..fab01298 100755 --- a/src/onionrstatistics/serializeddata.py +++ b/src/onionrstatistics/serializeddata.py @@ -52,4 +52,5 @@ class SerializedData: stats['blockCount'] = len(blockmetadb.get_block_list()) stats['blockQueueCount'] = len(comm_inst.blockQueue) stats['threads'] = proc.num_threads() + stats['ramPercent'] = proc.memory_percent() return json.dumps(stats) diff --git a/static-data/www/private/index.html b/static-data/www/private/index.html index cf210853..efd77806 100755 --- a/static-data/www/private/index.html +++ b/static-data/www/private/index.html @@ -268,6 +268,10 @@ Current CPU threads: +
+ + RAM usage: +
diff --git a/static-data/www/shared/main/stats.js b/static-data/www/shared/main/stats.js index 595fbfc0..e6f487e2 100755 --- a/static-data/www/shared/main/stats.js +++ b/static-data/www/shared/main/stats.js @@ -99,6 +99,7 @@ var getStats = function(){ storedBlockDisplay.innerText = stats['blockCount'] queuedBlockDisplay.innerText = stats['blockQueueCount'] document.getElementById('threads').innerText = stats['threads'] + document.getElementById('ramPercent').innerText = (stats['ramPercent']).toFixed(2) + '%' securityLevel.innerText = sec_description_str fetch('/hitcount', { headers: {