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

Merge branch 'fms-mon' into 'integration'

Fms mon

See merge request FLAME/flame-clmc!10
parents 28f13960 ccfd8703
No related branches found
No related tags found
No related merge requests found
...@@ -91,13 +91,12 @@ Vagrant.configure("2") do |config| ...@@ -91,13 +91,12 @@ Vagrant.configure("2") do |config|
instance_config.vm.provision :shell, :path => "scripts/clmc-service/#{host["start_script"]}" instance_config.vm.provision :shell, :path => "scripts/clmc-service/#{host["start_script"]}"
else else
# specific service install # specific service install
service_install_path = "test/services/#{host["service_name"]}/install-#{host["service_name"]}.sh" instance_config.vm.provision :shell, :path => "test/services/#{host["service_name"]}/install-#{host["service_name"]}.sh"
puts "installing service script: #{service_install_path}" # CLMC agent install
instance_config.vm.provision :shell, :path => service_install_path
# agent install
instance_config.vm.provision :shell, :path => "scripts/clmc-agent/install-clmc-agent.sh", :args => "/vagrant/test/services/#{host["service_name"]}/telegraf_#{host["service_name"]}_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"]}" instance_config.vm.provision :shell, :path => "scripts/clmc-agent/install-clmc-agent.sh", :args => "/vagrant/test/services/#{host["service_name"]}/telegraf_#{host["service_name"]}_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 end
end end
end end
......
...@@ -30,3 +30,20 @@ hosts: ...@@ -30,3 +30,20 @@ hosts:
ipendpoint_id: "adaptive_streaming_I1_apache1" ipendpoint_id: "adaptive_streaming_I1_apache1"
influxdb_url: "http://192.168.50.10:8086" influxdb_url: "http://192.168.50.10:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: vlc-client
cpus: 1
memory: 2048
disk: "10GB"
service_name: "vlc"
forward_ports:
- guest: 81
host: 8082
ip_address: "192.168.50.12"
location: "DC1"
sfc_id: "MS_Template_1"
sfc_id_instance: "MS_I1"
sf_id: "adaptive_streaming_client"
sf_id_instance: "adaptive_streaming_I1"
ipendpoint_id: "adaptive_streaming_I1_client1"
influxdb_url: "http://192.168.50.10:8086"
database_name: "CLMCMetrics"
...@@ -26,11 +26,19 @@ ...@@ -26,11 +26,19 @@
# Install apache # Install apache
sudo apt-get update sudo apt-get update
sudo apt-get -y install apache2 zip sudo apt-get -y install apache2
TEST_VIDEO="20180212104221flame-project-full.mp4"
TEST_VIDEO_ARCHIVE=$TEST_VIDEO".gz"
DEST_DIR="/var/www/html/"
DEST_FILE=$DEST_DIR"/"$TEST_VIDEO_ARCHIVE
# Copy files for MPEG-DASH testing # Copy files for MPEG-DASH testing
curl "ftp://ftp.it-innovation.soton.ac.uk/testdata/video/20180210-flame-project-video.zip" --user flame-rw:DR8ngj3ogSjd8gl -o "/var/www/html/20180210-flame-project-video.zip" curl "ftp://ftp.it-innovation.soton.ac.uk/testdata/video/"$TEST_VIDEO_ARCHIVE --user flame-rw:DR8ngj3ogSjd8gl -o $DEST_FILE
unzip /var/www/html/20180210-flame-project-video.zip -d /var/www/html/ tar -xvf $DEST_FILE -C /var/www/html/
rm -rf $DEST_FILE
mv $DEST_DIR"/"$TEST_VIDEO $DEST_DIR"/"test_video
# start apache # start apache
apachectl -k start apachectl -k start
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
## Run telegraf in quiet mode ## Run telegraf in quiet mode
quiet = false quiet = false
## Specify the log file name. The empty string means to log to stdout. ## Specify the log file name. The empty string means to log to stdout.
logfile = "G:/Telegraf/telegraf.log" logfile = "/var/log/telegraf/telegraf.log"
## Override default hostname, if empty use os.Hostname() ## Override default hostname, if empty use os.Hostname()
hostname = "" hostname = ""
......
...@@ -12,20 +12,23 @@ INPUT=$1 ...@@ -12,20 +12,23 @@ INPUT=$1
OUTPUT_iFRAMES="$1-iFrames.mp4" OUTPUT_iFRAMES="$1-iFrames.mp4"
OUTPUT_FRAGMENTED="$OUTPUT_iFRAMES-Fragmented.mp4" OUTPUT_FRAGMENTED="$OUTPUT_iFRAMES-Fragmented.mp4"
rm -rf output OUTPUT_FOLDER_NAME=$(date +%Y%m%d%H%M%S)$1
echo "OUTPUT_FOLDER_NAME: "$OUTPUT_FOLDER_NAME
rm -rf $OUTPUT_FOLDER_NAME
mkdir $OUTPUT_FOLDER_NAME
# Insert Correct number of I frames # Insert Correct number of I frames
#ffmpeg -y -i $INPUT -profile:v baseline -level 3.0 -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -maxrate 400k -bufsize 1000k -vf "scale=-1:360" $OUTPUT_iFRAMES #ffmpeg -y -i $INPUT -profile:v baseline -level 3.0 -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -maxrate 400k -bufsize 1000k -vf "scale=-1:360" $OUTPUT_iFRAMES
ffmpeg -y -i $INPUT -profile:v baseline -level 3.0 -c:a aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -maxrate 400k -bufsize 1000k -vf "scale=-1:360" -strict experimental $OUTPUT_iFRAMES ffmpeg -y -i $INPUT -profile:v baseline -level 3.0 -c:a aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -maxrate 400k -bufsize 1000k -vf "scale=-1:360" -strict experimental $OUTPUT_FOLDER_NAME"/"$OUTPUT_iFRAMES
# fragment MP4 # fragment MP4
/opt/Bento4-SDK-1-5-1-621.x86_64-unknown-linux/bin/mp4fragment --timescale 1000 $OUTPUT_iFRAMES $OUTPUT_FRAGMENTED /opt/Bento4-SDK-1-5-1-621.x86_64-unknown-linux/bin/mp4fragment --timescale 1000 $OUTPUT_FOLDER_NAME"/"$OUTPUT_iFRAMES $OUTPUT_FOLDER_NAME"/"$OUTPUT_FRAGMENTED
# Option 1 with Bento4 # Option 1 with Bento4
/opt/Bento4-SDK-1-5-1-621.x86_64-unknown-linux/bin/mp4dash --mpd-name=stream.mpd --use-segment-list --use-compat-namespace $OUTPUT_FRAGMENTED /opt/Bento4-SDK-1-5-1-621.x86_64-unknown-linux/bin/mp4dash --mpd-name=stream.mpd --use-segment-list --use-compat-namespace -o $OUTPUT_FOLDER_NAME"/"$OUTPUT_FOLDER_NAME $OUTPUT_FOLDER_NAME"/"$OUTPUT_FRAGMENTED
# not sure what this is for cd $OUTPUT_FOLDER_NAME
mv output/audio/en/mp4a/* output/audio/en tar -cvzf $OUTPUT_FOLDER_NAME".gz" $OUTPUT_FOLDER_NAME
rm -rf output/audio/en/mp4
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
## Run telegraf in quiet mode ## Run telegraf in quiet mode
quiet = false quiet = false
## Specify the log file name. The empty string means to log to stdout. ## Specify the log file name. The empty string means to log to stdout.
logfile = "G:/Telegraf/telegraf.log" logfile = "/var/log/telegraf/telegraf.log"
## Override default hostname, if empty use os.Hostname() ## Override default hostname, if empty use os.Hostname()
hostname = "" hostname = ""
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
## Run telegraf in quiet mode ## Run telegraf in quiet mode
quiet = false quiet = false
## Specify the log file name. The empty string means to log to stdout. ## Specify the log file name. The empty string means to log to stdout.
logfile = "G:/Telegraf/telegraf.log" logfile = "/var/log/telegraf/telegraf.log"
## Override default hostname, if empty use os.Hostname() ## Override default hostname, if empty use os.Hostname()
hostname = "" hostname = ""
......
#!/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 : 12/02/2018
#// Created for Project : FLAME
#//
#/////////////////////////////////////////////////////////////////////////
sudo add-apt-repository ppa:videolan/master-daily
sudo apt-get update
apt-get -y install vlc
\ No newline at end of file
# 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
...@@ -21,16 +21,69 @@ ...@@ -21,16 +21,69 @@
// Created for Project : FLAME // Created for Project : FLAME
--> -->
# CLMC Streaming Test # CLMC Adaptive Streaming Test
Install VLC video client, used a nightly build This test streamings mpeg-dash video using the apache server monitored by Telegraf configured with a default apache plugin. The data is stored in the `clmc-service` using database `CLMCMetrics` and measurement `apache`
https://nightlies.videolan.org/build/win32/vlc-3.0.0-rc1-20171201-0326/vlc-3.0.0-20171201-0326-rc1-win32.exe The following command brings up the services
`vagrant --infra=streaming up` `vagrant --infra=streaming up`
* clmc-service: configured with influx, kapacitor, chornograf
* apache1: configured with apache and a test video located at http://192.168.50.11:80/test-video/stream.mpd on the internal vbox network adn at http://localhost:8890/test-video/stream.mpd if accessing from the host machine
## Manual test on Windows
### View the video
Install VLC video client on the host machine, you must use a very recent version otherwise the MPD file cannot we read. At the time of writng the following nighly build was installed:
https://nightlies.videolan.org/build/win32/vlc-3.0.0-rc1-20171201-0326/vlc-3.0.0-20171201-0326-rc1-win32.exe
Start the VLC Player Start the VLC Player
`Media->Open Network Stream` `Media->Open Network Stream`
`Enter the network URL: http://localhost:8890/flame-video/stream.mpd` The test video is the FLAME project video and it can be viewed at the following location.
`Enter the network URL: http://localhost:8890/test-video/stream.mpd`
The video should play.
### Query the data
Open Chronograph by entering the following URL into a browser on the host http://localhost:8888
Connect with
* Connection String: http://localhost:8086
* Name: Influx 1
* Telegraf database: CLMCMetrics
Press the Data Explorer in the menu
Select the apache measurement and create a query such as
`SELECT mean("BytesPerSec") AS "mean_BytesPerSec" FROM "CLMCMetrics"."autogen"."apache" WHERE time > now() - 5m GROUP BY time(10s)`
## Set a KPI trigger
Press Alerting in the menu
Connect to Kapacitor on http://locahost:9092
Create a rule CLMCMetrics.apache.cpu_load > 0.02
There's all sorts of notification possibilities
## Automatic test using JMeter and VLC command line
To be completed.
* Create a VM called `vlc-client` with vlc and jmeter installed
* Write a testcase using the JMeter GUI that streams the test video to a set of clients.
* The options for scaling the number of client threads needs to be explored
* The test conditions needs to be defined i.e. triggers at specific thresholds when cpu usage reaches a certain point
Issues, the Vagrantfile needs updating as the `vlc-client` needs to run two provisioning scripts adn the assumption is there's one provisioning script and the telegraf provisioning script. Looks like a hack is coming....if `vlc-client` then provision jmeter.
We then need programtically create rules using the kapacitor CLI to set the KPIs and get the alerts rather than all the manual set up
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment