summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/adv_graphgen/parse_tinc_anon.py
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-04-29 13:39:54 +0200
committermakefu <github@syntax-fehler.de>2013-04-29 13:39:54 +0200
commitb0273180da89e11cd6a7346ed1a72e9f17fbf230 (patch)
treeb4dbfa157032ce5168099a552d0280764cbb505f /retiolum/scripts/adv_graphgen/parse_tinc_anon.py
parent5266540d4c21494adbac3f25f982f2bf32390734 (diff)
parent5d904ef7620cda3355b601793441fc804ff506a9 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/scripts/adv_graphgen/parse_tinc_anon.py')
-rwxr-xr-xretiolum/scripts/adv_graphgen/parse_tinc_anon.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/retiolum/scripts/adv_graphgen/parse_tinc_anon.py b/retiolum/scripts/adv_graphgen/parse_tinc_anon.py
index 21c36e0f..82ee2f2e 100755
--- a/retiolum/scripts/adv_graphgen/parse_tinc_anon.py
+++ b/retiolum/scripts/adv_graphgen/parse_tinc_anon.py
@@ -52,11 +52,13 @@ def write_stat_node(nodes):
''' Write a `stats` node in the corner
This node contains infos about the current number of active nodes and connections inside the network
'''
+ from time import localtime,strftime
num_conns = 0
num_nodes = len(nodes)
for k,v in nodes.iteritems():
num_conns+= len(v['to'])
node_text = " stats_node [shape=box,label=\"Statistics\\l"
+ node_text += "Build Date : %s\\l" % strftime("%Y-%m-%d %H:%M:%S",localtime())
node_text += "Active Nodes: %s\\l" % num_nodes
node_text += "Connections : %s\\l" % num_conns
node_text += "\""