Last active
May 20, 2017 17:16
-
-
Save mago0/5c11440b75128d5b206393c4fa6fa6e1 to your computer and use it in GitHub Desktop.
Segment of Redline13 Executor Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rest-client' | |
require 'json' | |
require 'pp' | |
opts = { | |
threads: '1', | |
rampup: '0', | |
drm_key: 'REDACTED', | |
drm_pass: 'REDACTED', | |
stream_origin: 'REDACTED', | |
stream_name: 'REDACTED', | |
bandwidth_mbit: '10', | |
lag_ratio_limit: '20', | |
chunk_fetch_count: '10', | |
chunk_fetch_interval: '9' | |
} | |
# Duration needs to be long enough to allow for rampup without cutting off streams prematurely. | |
duration = $rampup.to_i + 5 + $chunk_fetch_count.to_i * $chunk_fetch_interval.to_i | |
ubik_license = string = File.open('../ubik-streaming-plugin.license', 'rb') { |file| file.read } | |
api_url = 'https://www.redline13.com/Api' | |
redline_key = 'REDACTED' | |
redline = RestClient::Resource.new( | |
"#{api_url}", | |
'headers': { | |
'Accept': 'application/json', | |
'Content-Type': 'application/x-www-form-urlencoded', | |
'X-Redline-Auth': "#{redline_key}" | |
} | |
) | |
pp JSON.parse(redline['/LoadTest'].post({ | |
'testType': 'jmeter-test', | |
'name': 'API Test 1', | |
'file': File.new('../Live-Stream-Test.jmx', 'rb'), | |
'numServers': 1, | |
'storeOutput': 'T', | |
'version': '3.1', | |
'opts': "#{opts.map {|k,v| "-G#{k}=#{v} "}.join(' ').to_s.strip}", | |
'plugin[0]': 'standard', | |
'plugin[1]': 'extras', | |
'plugin[2]': 'extraswithlibs', | |
'plugin[3]': 'ubikstream', | |
'jmeter-ubikstream-license': "#{ubik_license}", | |
'servers[0][location]': 'us-east-1', | |
'servers[0][size]': 'm3.medium', | |
'servers[0][num]': 1, | |
'servers[0][onDemand]': 'T', | |
'servers[0][usersPerServer]': 1, | |
'keyPairId': 'REDACTED' | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment