summaryrefslogtreecommitdiff
path: root/src/flufigut.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/flufigut.py')
-rwxr-xr-xsrc/flufigut.py33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/flufigut.py b/src/flufigut.py
index 04216ea..635b48c 100755
--- a/src/flufigut.py
+++ b/src/flufigut.py
@@ -226,14 +226,45 @@ for cluster in stream.keys():
for profile in transcode[format]:
feeder = 'muxer-%s-%s' % (format, profile)
name = '%s-%s%i-%s-%s' % (stream[cluster]['type'], cluster, idx+1, format, profile)
+ mount_point = '/%s-%s.%s' % (format, profile, globals['formats'][format]['muxer'])
+ if streamer_cnt > 1:
+ hostname = "%s.%s" % (stream[cluster]['hostname'] % (idx+1), globals['domain'])
+ if idx != 0:
+ hostname_next = "%s.%s" % (stream[cluster]['hostname'] % (idx), globals['domain'])
+ else:
+ hostname_next = "%s.%s" % (stream[cluster]['hostname'] % (streamer_cnt), globals['domain'])
+ else:
+ hostname = "%s.%s" % (stream[cluster]['hostname'], globals['domain'])
flow['streamer'][name] = {
'type': "%s-stream" % stream[cluster]['type'],
- 'desc': "%s streamer for %s-%s (part %i of %s)" % (stream[cluster]['type'], format, profile, idx+1, cluster),
+ 'desc': "%s streamer for %s-%s (part %i of %s cluster)" % (stream[cluster]['type'], format, profile, idx+1, cluster),
'worker': 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',
+ 'porter-socket-path': machines[machine]['porter'][port]['socket-path'],
+ 'porter-username': machines[machine]['porter'][port]['username'],
+ 'porter-password': machines[machine]['porter'][port]['password'],
+ 'mount-point': mount_point,
+ 'hostname': hostname,
+ 'port': port,
}
}
+ for prop in stream[cluster]:
+ if prop == 'max-con':
+ flow['streamer'][name]['properties']['client-limit'] = stream[cluster][prop]
+ if streamer_cnt > 1:
+ flow['streamer'][name]['properties']['redirect-on-overflow'] = "http://%s:%i%s" % (hostname_next, port, mount_point)
+ if prop == 'max-bw':
+ flow['streamer'][name]['properties']['bandwidth-limit'] = stream[cluster][prop]
+ if streamer_cnt > 1:
+ flow['streamer'][name]['properties']['redirect-on-overflow'] = "http://%s:%i%s" % (hostname_next, port, mount_point)
+ if prop == 'burst-on-connect':
+ flow['streamer'][name]['properties']['burst-on-connect'] = 'true'
+ flow['streamer'][name]['properties']['burst-time'] = stream[cluster][prop]
### initialize and render templates #############################