Skip to content
Snippets Groups Projects
Commit 98910405 authored by Michael Boniface's avatar Michael Boniface
Browse files

Merge branch 'load-gen' into 'integration'

Load gen

See merge request FLAME/flame-clmc!14
parents a5c9b4db 632cc1e2
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,8 @@ Vagrant.configure("2") do |config|
instance_config.vm.provision :shell, :path => "scripts/clmc-service/install.sh"
else
# specific service install
instance_config.vm.provision :shell, :path => "test/services/#{host["service_name"]}/install.sh"
instance_config.vm.provision :shell, :path => "test/services/#{host["service_name"]}/install.sh", env: {"REPO_ROOT" => "/vagrant"}
# CLMC agent install
instance_config.vm.provision :shell, :path => "scripts/clmc-agent/install.sh", :args => "/vagrant/test/services/#{host["service_name"]}/telegraf_template.conf #{host["location"]} #{host["sfc_id"]} #{host["sfc_id_instance"]} #{host["sf_id"]} #{host["sf_id_instance"]} #{host["ipendpoint_id"]} #{host["influxdb_url"]} #{host["database_name"]}"
end
......
......@@ -12,8 +12,8 @@ hosts:
host: 9092
ip_address: "192.168.50.10"
- name: apache1
cpus: 1
memory: 2048
cpus: 2
memory: 4096
disk: "10GB"
service_name: "apache"
forward_ports:
......@@ -29,8 +29,8 @@ hosts:
influxdb_url: "http://192.168.50.10:8086"
database_name: "CLMCMetrics"
- name: apache2
cpus: 1
memory: 2048
cpus: 2
memory: 4096
disk: "10GB"
service_name: "apache"
forward_ports:
......@@ -45,11 +45,11 @@ hosts:
ipendpoint_id: "adaptive_streaming_I1_apache2"
influxdb_url: "http://192.168.50.10:8086"
database_name: "CLMCMetrics"
- name: vlc-client
cpus: 1
memory: 2048
- name: loadtest-streaming
cpus: 2
memory: 4096
disk: "10GB"
service_name: "vlc"
service_name: "loadtest-streaming"
forward_ports:
- guest: 80
host: 8083
......
#!/bin/bash
sudo apt-get update
sudo apt-get -y install zip python
apt-get update
apt-get -y install zip python
wget http://zebulon.bok.net/Bento4/binaries/Bento4-SDK-1-5-1-621.x86_64-unknown-linux.zip
unzip Bento4-SDK-1-5-1-621.x86_64-unknown-linux.zip
......@@ -9,7 +9,7 @@ unzip Bento4-SDK-1-5-1-621.x86_64-unknown-linux.zip
mv Bento4-SDK-1-5-1-621.x86_64-unknown-linux /opt/
rm Bento4-SDK-1-5-1-621.x86_64-unknown-linux.zip
sudo add-apt-repository ppa:jonathonf/ffmpeg-3
sudo apt-get update && sudo apt -y install ffmpeg libav-tools x264 x265
add-apt-repository -y ppa:jonathonf/ffmpeg-3
apt-get update && apt -y install ffmpeg libav-tools x264 x265
ffmpeg -version
......@@ -31,13 +31,16 @@ apt-get -y update
# tell the oracle java installer the license has been read
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" oracle-java8-installer
# install JMeter
wget http://apache.mirrors.nublue.co.uk//jmeter/binaries/apache-jmeter-3.3.tgz -P /tmp
tar -C /opt -xf /tmp/apache-jmeter-3.3.tgz
rm -rf /tmp/apache-jmeter-3.3.tgz
JMETER_VERSION="apache-jmeter-4.0"
wget http://mirror.vorboss.net/apache//jmeter/binaries/$JMETER_VERSION.tgz -P /tmp
tar -C /opt -xf /tmp/$JMETER_VERSION.tgz
rm -rf /tmp/$JMETER_VERSION.tgz
# Add jmeter to the path system wide
echo 'PATH="'$PATH':/opt/apache-jmeter-3.3/bin"' > /etc/environment
#echo 'PATH="'$PATH':/opt/'$JMETER_VERSION'/bin"' > /etc/environment
echo 'PATH="'$PATH':/opt/apache-jmeter-4.0/bin"' > /etc/environment
source /etc/environment
#!/bin/bash
#/////////////////////////////////////////////////////////////////////////
#//
#// (c) University of Southampton IT Innovation Centre, 2017
#//
#// Copyright in this software belongs to University of Southampton
#// IT Innovation Centre of Gamma House, Enterprise Road,
#// Chilworth Science Park, Southampton, SO16 7NS, UK.
#//
#// This software may not be used, sold, licensed, transferred, copied
#// or reproduced in whole or in part in any manner or form or in or
#// on any media by any person other than in accordance with the terms
#// of the Licence Agreement supplied with the software, or otherwise
#// without the prior written consent of the copyright owners.
#//
#// This software is distributed WITHOUT ANY WARRANTY, without even the
#// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#// PURPOSE, except where stated in the Licence Agreement supplied with
#// the software.
#//
#// Created By : Michael Boniface
#// Created Date : 14/02/2018
#// Created for Project : FLAME
#//
#/////////////////////////////////////////////////////////////////////////
set -euo pipefail
echo "REPO_ROOT:"$REPO_ROOT
eval '$REPO_ROOT/test/services/vlc/install.sh'
eval '$REPO_ROOT/test/services/jmeter/install.sh'
# Telegraf configuration
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
# Plugins must be declared in here to be active.
# To deactivate a plugin, comment out the name and any variables.
# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
# file would generate.
# Global tags can be specified here in key="value" format.
[global_tags]
# location of the data centre
location="{{LOCATION}}"
# media service template id
sfc="{{SFC_ID}}"
# media service instance
sfc_i="{{SFC_ID_INSTANCE}}"
# service function type
sf="{{SF_ID}}"
# service function instance id
sf_i="{{SF_ID_INSTANCE}}"
# ipendpoint id aka surrogate instance
ipendpoint="{{IP_ENDPOINT_ID}}"
# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputs
interval = "10s"
## Rounds collection interval to 'interval'
## ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = true
## Telegraf will cache metric_buffer_limit metrics for each output, and will
## flush this buffer on a successful write.
metric_buffer_limit = 1000
## Flush the buffer whenever full, regardless of flush_interval.
flush_buffer_when_full = true
## Collection jitter is used to jitter the collection by a random amount.
## Each plugin will sleep for a random time within jitter before collecting.
## This can be used to avoid many plugins querying things like sysfs at the
## same time, which can have a measurable effect on the system.
collection_jitter = "0s"
## Default flushing interval for all outputs. You shouldn't set this below
## interval. Maximum flush_interval will be flush_interval + flush_jitter
flush_interval = "10s"
## Jitter the flush interval by a random amount. This is primarily to avoid
## large write spikes for users running a large number of telegraf instances.
## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
flush_jitter = "0s"
## Logging configuration:
## Run telegraf in debug mode
debug = false
## Run telegraf in quiet mode
quiet = false
## Specify the log file name. The empty string means to log to stdout.
logfile = "/var/log/telegraf/telegraf.log"
## Override default hostname, if empty use os.Hostname()
hostname = ""
###############################################################################
# OUTPUTS #
###############################################################################
# Configuration for influxdb server to send metrics to
[[outputs.influxdb]]
# The full HTTP or UDP endpoint URL for your InfluxDB instance.
# Multiple urls can be specified but it is assumed that they are part of the same
# cluster, this means that only ONE of the urls will be written to each interval.
# urls = ["udp://127.0.0.1:8089"] # UDP endpoint example
urls = ["{{INFLUXDB_URL}}"] # required
# The target database for metrics (telegraf will create it if not exists)
database = "{{DATABASE_NAME}}" # required
# Precision of writes, valid values are "ns", "us" (or "µs"), "ms", "s", "m", "h".
# note: using second precision greatly helps InfluxDB compression
precision = "s"
## Write timeout (for the InfluxDB client), formatted as a string.
## If not provided, will default to 5s. 0s means no timeout (not recommended).
timeout = "5s"
# username = "telegraf"
# password = "metricsmetricsmetricsmetrics"
# Set the user agent for HTTP POSTs (can be useful for log differentiation)
# user_agent = "telegraf"
# Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)
# udp_payload = 512
###############################################################################
# INPUTS #
###############################################################################
# # Influx HTTP write listener
[[inputs.http_listener]]
## Address and port to host HTTP listener on
service_address = ":8186"
## timeouts
read_timeout = "10s"
write_timeout = "10s"
## HTTPS
#tls_cert= "/etc/telegraf/cert.pem"
#tls_key = "/etc/telegraf/key.pem"
## MTLS
#tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
\ No newline at end of file
......@@ -24,6 +24,6 @@
#//
#/////////////////////////////////////////////////////////////////////////
sudo add-apt-repository ppa:videolan/master-daily
sudo apt-get update
add-apt-repository -y ppa:videolan/master-daily
apt-get update
apt-get -y install vlc
\ No newline at end of file
#!/bin/bash
#/////////////////////////////////////////////////////////////////////////
#//
#// (c) University of Southampton IT Innovation Centre, 2017
#//
#// Copyright in this software belongs to University of Southampton
#// IT Innovation Centre of Gamma House, Enterprise Road,
#// Chilworth Science Park, Southampton, SO16 7NS, UK.
#//
#// This software may not be used, sold, licensed, transferred, copied
#// or reproduced in whole or in part in any manner or form or in or
#// on any media by any person other than in accordance with the terms
#// of the Licence Agreement supplied with the software, or otherwise
#// without the prior written consent of the copyright owners.
#//
#// This software is distributed WITHOUT ANY WARRANTY, without even the
#// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#// PURPOSE, except where stated in the Licence Agreement supplied with
#// the software.
#//
#// Created By : Michael Boniface
#// Created Date : 15/02/2017
#// Created for Project : FLAME
#//
#/////////////////////////////////////////////////////////////////////////
# create test directories
testfolder=$(date +%Y%m%d%H%M%S)
testrundir="/vagrant/test/run"
testdir=$testrundir"/streaming/"$testfolder
echo "Test directory: "$testdir
mkdir -p "$testdir"
# run testplan
cd $testdir
jmeter -n -LDEBUG -t /vagrant/test/streaming/testplan.jmx -l results.jtx -j jmeter.log
# quick bash equivalent in case Jmeter fails
#COUNTER=0
#while [ $COUNTER -lt 1 ]; do
# cvlc -Vdummy --no-audio http://192.168.50.11/test_video/stream.mpd &
# sleep 1
# let COUNTER=COUNTER+1
#done
#!/bin/bash
for pid in $(ps -ef | grep "/usr/bin/vlc" | awk '{print $2}'); do kill -9 $pid; done
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.3 r1808647">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="StreamingGroupApache1" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<intProp name="LoopController.loops">-1</intProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">5</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1518691643000</longProp>
<longProp name="ThreadGroup.end_time">1518691643000</longProp>
<boolProp name="ThreadGroup.scheduler">true</boolProp>
<stringProp name="ThreadGroup.duration">10</stringProp>
<stringProp name="ThreadGroup.delay">0</stringProp>
</ThreadGroup>
<hashTree>
<SystemSampler guiclass="SystemSamplerGui" testclass="SystemSampler" testname="VLC Client" enabled="true">
<boolProp name="SystemSampler.checkReturnCode">false</boolProp>
<stringProp name="SystemSampler.expectedReturnCode">0</stringProp>
<stringProp name="SystemSampler.command">cvlc</stringProp>
<elementProp name="SystemSampler.arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="Argument">
<stringProp name="Argument.name"></stringProp>
<stringProp name="Argument.value">-Vdummy</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="" elementType="Argument">
<stringProp name="Argument.name"></stringProp>
<stringProp name="Argument.value">--no-audio</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="" elementType="Argument">
<stringProp name="Argument.name"></stringProp>
<stringProp name="Argument.value">http://192.168.50.11/test_video/stream.mpd</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<elementProp name="SystemSampler.environment" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="SystemSampler.directory"></stringProp>
<stringProp name="SystemSampler.stdout">stdout${__threadNum}</stringProp>
<longProp name="SystemSampler.timeout">10000</longProp>
</SystemSampler>
<hashTree/>
</hashTree>
</hashTree>
<WorkBench guiclass="WorkBenchGui" testclass="WorkBench" testname="WorkBench" enabled="true">
<boolProp name="WorkBench.save">true</boolProp>
</WorkBench>
<hashTree/>
</hashTree>
</jmeterTestPlan>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment