summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/adv_graphgen/parse_tinc_anon.py
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2012-06-08 20:34:23 +0200
committermakefu <github@syntax-fehler.de>2012-06-08 20:34:23 +0200
commita0321c82c7f80d1052108c4a1602b775799e4593 (patch)
tree4a9af394716216cf3e56dd022b8f0d30746efac6 /retiolum/scripts/adv_graphgen/parse_tinc_anon.py
parentdd1ba866c0f93500e1d3e4876fc75955be9d976a (diff)
parent6046373ce92a9c9856d828b37cda28af437e36be (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.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/retiolum/scripts/adv_graphgen/parse_tinc_anon.py b/retiolum/scripts/adv_graphgen/parse_tinc_anon.py
index 3b0383da..c603d398 100755
--- a/retiolum/scripts/adv_graphgen/parse_tinc_anon.py
+++ b/retiolum/scripts/adv_graphgen/parse_tinc_anon.py
@@ -3,6 +3,17 @@
from BackwardsReader import BackwardsReader
import sys,json
#supernodes= [ "kaah","supernode","euer","pa_sharepoint","oxberg" ]
+try:
+ import socket
+ from time import time
+ host = "localhost"
+ port = 2003
+ g_path = "retiolum"
+ begin = time()
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.connect((host,port))
+except Exception as e:
+ print >>sys.stderr, "Cannot connect to graphite: " + str(e)
""" TODO: Refactoring needed to pull the edges out of the node structures again,
it should be easier to handle both structures"""
DUMP_FILE = "/krebs/db/availability"
@@ -133,3 +144,9 @@ def decode_input(FILE):
nodes = decode_input(sys.stdin)
nodes = delete_unused_nodes(nodes)
write_digraph(nodes)
+try:
+ end = time()
+ msg = '%s.graph.anon_build_time %d %d\n' % (g_path,((end-begin)*1000),end)
+ s.send(msg)
+ s.close()
+except Exception as e: print >>sys.stderr, e