Merge pull request #31 from sargon/master

global rrd: Count online nodes instead of nodes in state
legacy
Nils Schneider 2014-09-23 09:16:51 +02:00
commit 878267ca0e
1 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,8 @@ class rrd:
nodes = db.get_nodes() nodes = db.get_nodes()
clientCount = sum(map(lambda d: d.clientcount, nodes)) clientCount = sum(map(lambda d: d.clientcount, nodes))
self.globalDb.update(len(nodes), clientCount) curtime = time.time() - 60
self.globalDb.update(len(list(filter(lambda x: x.lastseen >= curtime, nodes))), clientCount)
for node in nodes: for node in nodes:
rrd = NodeRRD( rrd = NodeRRD(
os.path.join(self.dbPath, str(node.id).replace(':', '') + '.rrd'), os.path.join(self.dbPath, str(node.id).replace(':', '') + '.rrd'),