From 95346385f0b6e36050c4bc5fa3f00aadc0c5fbcf Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 11 Oct 2014 17:38:13 +0200 Subject: redone http plugs, added support for sfive --- src/flufigut.py | 21 +++++++++++++++++---- templates/flumotion/default/http-stream.xml | 27 +++++++++++++++++++-------- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/flufigut.py b/src/flufigut.py index f29deb3..83e1220 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -403,10 +403,23 @@ 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) + + if 'stats' in globals.keys(): + flow['streamer'][name]['plugs'] = {} + if 'rrd' in globals['stats'].keys(): + flow['streamer'][name]['plugs']['rrd'] = {} + flow['streamer'][name]['plugs']['rrd']['clients'] = "%s/%s_clients.rrd" % (globals['stats']['rrd']['directory'], name) + flow['streamer'][name]['plugs']['rrd']['bytes'] = "%s/%s_bytes.rrd" % (globals['stats']['rrd']['directory'], name) + + if 'sfive' in globals['stats'].keys(): + flow['streamer'][name]['plugs']['sfive'] = {} + flow['streamer'][name]['plugs']['sfive']['socket'] = globals['stats']['sfive']['socket'] + flow['streamer'][name]['plugs']['sfive']['duration'] = globals['stats']['sfive']['duration'] + flow['streamer'][name]['plugs']['sfive']['tags'] = globals['stats']['sfive']['tags'] + flow['streamer'][name]['plugs']['sfive']['hostname'] = '%s-%s%i' % (stream[cluster]['type'], cluster, idx+1) + flow['streamer'][name]['plugs']['sfive']['content-id'] = mux_name + flow['streamer'][name]['plugs']['sfive']['format'] = format + flow['streamer'][name]['plugs']['sfive']['quality'] = profile for prop in stream[cluster]: if prop == 'max-con': diff --git a/templates/flumotion/default/http-stream.xml b/templates/flumotion/default/http-stream.xml index 3de894a..f9af92e 100644 --- a/templates/flumotion/default/http-stream.xml +++ b/templates/flumotion/default/http-stream.xml @@ -7,18 +7,29 @@ {{ component.feeder }} +%% if component.plugs is defined -%% if component.rrd_dir is defined +%% for name, value in component.plugs.items() +%% if name == 'rrd' -%% if component.rrd_clients is defined - {{ component.rrd_clients }} -%% endif -%% if component.rrd_bytes is defined - {{ component.rrd_bytes }} -%% endif + {{ value.clients }} + {{ value.bytes }} -%% endif +%% endif +%% if name == 'sfive' + +%% for name, value in value.items() +%% if name != 'tags' + {{ value }} +%% else + {{ value|join(', ') }} +%% endif +%% endfor + +%% endif +%% endfor +%% endif %% for name, value in component.properties.items() %% if name != 'samplerate' {{ value }} -- cgit v1.2.3