From 2151566b747fad9ec4df667458acea53b8bbc448 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 15 Apr 2019 18:25:50 -0400 Subject: [PATCH] Send total memory via ZK so its accurate --- node-daemon/pvcd/Daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node-daemon/pvcd/Daemon.py b/node-daemon/pvcd/Daemon.py index 21e74151..a0763d1b 100644 --- a/node-daemon/pvcd/Daemon.py +++ b/node-daemon/pvcd/Daemon.py @@ -1033,6 +1033,7 @@ def update_zookeeper(): if debug: print("Set our information in zookeeper") #this_node.name = lv_conn.getHostname() + this_node.memtotal = int(psutil.virtual_memory().total / 1024 / 1024) this_node.memused = int(psutil.virtual_memory().used / 1024 / 1024) this_node.memfree = int(psutil.virtual_memory().free / 1024 / 1024) this_node.memalloc = memalloc @@ -1045,6 +1046,7 @@ def update_zookeeper(): keepalive_time = int(time.time()) try: zkhandler.writedata(zk_conn, { + '/nodes/{}/memtotal'.format(this_node.name): str(this_node.memtotal), '/nodes/{}/memused'.format(this_node.name): str(this_node.memused), '/nodes/{}/memfree'.format(this_node.name): str(this_node.memfree), '/nodes/{}/memalloc'.format(this_node.name): str(this_node.memalloc),