From 4ad734a5aa2664e7af0cd758d03dcaf19b20c668 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 9 Oct 2014 18:45:07 +0200 Subject: the rrd plug is now optional --- src/flufigut.py | 7 +++++-- templates/flumotion/default/http-stream.xml | 6 ++++++ templates/flumotion/default/http2-stream.xml | 8 ++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/flufigut.py b/src/flufigut.py index 31a2262..f2ddf90 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -333,8 +333,6 @@ if output_format == 'flumotion': 'desc': "%s streamer for %s %s-%s (part %i of %s cluster)" % (stream[cluster]['type'], mux_name, format, profile, idx+1, cluster), 'worker': stream_worker, 'feeder': feeder, - 'rrd_clients' : "%s/%s_clients.rrd" % (globals['rrd-dir'], name), - 'rrd_bytes' : "%s/%s_bytes.rrd" % (globals['rrd-dir'], name), 'properties': { 'description': globals['description'], 'type': 'slave', @@ -346,6 +344,11 @@ if output_format == 'flumotion': 'port': port, } } + if 'rrd-dir' in globals.keys(): + flow['streamer'][name]['rrd_dir'] = globals['rrd-dir'], name + flow['streamer'][name]['rrd_clients'] = "%s/%s_clients.rrd" % (globals['rrd-dir'], name) + flow['streamer'][name]['rrd_bytes'] = "%s/%s_bytes.rrd" % (globals['rrd-dir'], name) + for prop in stream[cluster]: if prop == 'max-con': flow['streamer'][name]['properties']['client-limit'] = stream[cluster][prop] diff --git a/templates/flumotion/default/http-stream.xml b/templates/flumotion/default/http-stream.xml index 561097a..3de894a 100644 --- a/templates/flumotion/default/http-stream.xml +++ b/templates/flumotion/default/http-stream.xml @@ -8,10 +8,16 @@ {{ component.feeder }} +%% if component.rrd_dir is defined +%% if component.rrd_clients is defined {{ component.rrd_clients }} +%% endif +%% if component.rrd_bytes is defined {{ component.rrd_bytes }} +%% endif +%% endif %% for name, value in component.properties.items() %% if name != 'samplerate' diff --git a/templates/flumotion/default/http2-stream.xml b/templates/flumotion/default/http2-stream.xml index 74c881e..6e1e100 100644 --- a/templates/flumotion/default/http2-stream.xml +++ b/templates/flumotion/default/http2-stream.xml @@ -19,12 +19,16 @@ {{ '%s_rep' % (name) }} - +%% if component.rrd_dir is defined +%% if component.rrd_clients is defined {{ component.rrd_clients }} +%% endif +%% if component.rrd_bytes is defined {{ component.rrd_bytes }} +%% endif - +%% endif %% for name, value in component.properties.items() %% if name != 'samplerate' {{ value }} -- cgit v1.2.3