summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/adv_graphgen
diff options
context:
space:
mode:
authorEUcancER <root@euer.krebsco.de>2012-06-01 15:31:44 +0200
committerEUcancER <root@euer.krebsco.de>2012-06-01 15:31:44 +0200
commitff93336964b5c59bb2e7ddfb790884593d8276ba (patch)
tree4d78560fc45ff27b584446009b74677a19dcf31a /retiolum/scripts/adv_graphgen
parentd72588e1da8c075daf791256593be20c9b67ea25 (diff)
//retiolum: adv_graphgen send stats via statsd
Diffstat (limited to 'retiolum/scripts/adv_graphgen')
-rwxr-xr-xretiolum/scripts/adv_graphgen/all_the_graphs.sh10
-rwxr-xr-xretiolum/scripts/adv_graphgen/parse_tinc_stats.py12
2 files changed, 21 insertions, 1 deletions
diff --git a/retiolum/scripts/adv_graphgen/all_the_graphs.sh b/retiolum/scripts/adv_graphgen/all_the_graphs.sh
index 36b37f03..2a41df38 100755
--- a/retiolum/scripts/adv_graphgen/all_the_graphs.sh
+++ b/retiolum/scripts/adv_graphgen/all_the_graphs.sh
@@ -1,5 +1,13 @@
-#!/bin/sh
+#!/bin/bash
echo "`date` begin all graphs" >> /tmp/build_graph
cd $(dirname $(readlink -f $0))
+PATH=$PATH:../../../util/bin/
+begin=`timer`
(./anonytize.sh /srv/http/pub/graphs/retiolum/ && echo "`date` anonytize done" >> /tmp/build_graph)&
(./sanitize.sh /srv/http/priv/graphs/retiolum/ && echo "`date` sanitize done" >> /tmp/build_graph)&
+for job in `jobs -p`
+do
+ echo $job
+ wait $job || echo "$job failed!"
+done
+statsc "graphs.buildtime:$(timer $begin)|ms"
diff --git a/retiolum/scripts/adv_graphgen/parse_tinc_stats.py b/retiolum/scripts/adv_graphgen/parse_tinc_stats.py
index 54dcc4ab..c676ad20 100755
--- a/retiolum/scripts/adv_graphgen/parse_tinc_stats.py
+++ b/retiolum/scripts/adv_graphgen/parse_tinc_stats.py
@@ -2,6 +2,14 @@
# -*- coding: utf8 -*-
from BackwardsReader import BackwardsReader
import sys,json
+try:
+ import statsd
+except:
+ print >>sys.stderr,'!! no statsd installed, try `pip install statsd`'
+ timer = statsd.Timer("graph.detail")
+ timer.start()
+ gauge = statsd.Gauge('graph.detail')
+
supernodes= [ "kaah","supernode","euer","pa_sharepoint","oxberg" ]
""" TODO: Refactoring needed to pull the edges out of the node structures again,
it should be easier to handle both structures"""
@@ -36,6 +44,8 @@ def write_stat_node(nodes):
'''
num_conns = 0
num_nodes = len(nodes)
+ try: gauge.send('num_nodes',num_nodes)
+ except: pass
for k,v in nodes.iteritems():
num_conns+= len(v['to'])
node_text = " stats_node [label=\"Statistics\\l"
@@ -183,3 +193,5 @@ try:
except Exception,e:
sys.stderr.write("Cannot dump graph: %s" % str(e))
write_digraph(nodes)
+try: timer.stop("execution_time")
+except: pass