Child pages
  • SB Database Statistics Plugin
Skip to end of metadata
Go to start of metadata

SB Database Statistics Plugin

Description

This plugin monitors the actions on streams, and logs them in a database

Prerequisites

Tested on Wowza 4.0.3
Requires a JDBC enabled database.

Configuration

Configuring Wowza

Configuration is done in the file 'conf/chaos/Application.xml' relative to the VHost path of the plugin (see Installation).
The file is based on 'examples/SimpleVideoStreaming/conf/vod/Application.xml' from the Wowza system directory. It must be updated with the following step:

Add the Statistics module

[...]
<Modules>
    [...]
    <Module>
        <Name>Chaos-SB-Logging</Name>
        <Description>Statsbiblioteket Chaos logging datebase module</Description>
        <Class>dk.statsbiblioteket.medieplatform.wowza.plugin.statistic.StatisticLoggingSBModuleBase</Class>
    </Module>
</Modules>
[...]

Configuring plugin

Configuration is read from the file 'conf/chaos/chaos-streaming-server-plugin.properties' relative to the VHost path of the plugin (see Installation)

The following keys are used:

StatisticsLoggingJDBCDriver=org.postgresql.Driver
StatisticsLoggingDBConnectionURL=jdbc:postgresql://localhost:5432/chaos-streaming-server-log
StatisticsLoggingDBUser=wowzalog
StatisticsLoggingDBPassword=password

Configuring logging

Logging is done at VHost level. Edit the file 'conf/log4j.properties' relative to the VHost path of the plugin (see Installation) to set the desired log levels.

Database configuration

The database must have the following table created:

CREATE TABLE events (
	event_id INTEGER NOT NULL, 
	timestamp TIMESTAMP, 
	stream_name VARCHAR, 
	event_type VARCHAR, 
	user_id INTEGER, 
	started_at INTEGER, 
	ended_at INTEGER, 
	PRIMARY KEY (event_id));

Installation

Assuming a Wowza server installed in $WOWZADIR configured with a toplevel directory for a VHost called $VHOSTDIR, the following is needed:

Add the distributed JAR files to $VHOSTDIR/applications/lib (note: distributed are database drivers for postgresql-9 and hsql. If another database is desired, the appropriate JDBC driver must be deployed as well)
Create the directory $VHOSTDIR/conf/chaos
Place the configuration file in $VHOSTDIR/conf/chaos/chaos-streaming-server-plugin.properties
Place the application file in $VHOSTDIR/conf/chaos/Application.xml
Create the directory $VHOSTDIR/applications/chaos

(To use an external VHost dir, follow the instructions from http://www.wowza.com/resources/WowzaMediaServer_UsersGuide.pdf section "Virtual Hosting")

Testing

In a browser, open the URL

file:///usr/local/WowzaStreamingEngine/examples/VideoOnDemandStreaming/FlashRTMPPlayer/player.html

(replace /usr/local/WowzaStreamingEngine with $WOWZADIR)

At server, type
rtmp://localhost/chaos

At stream, type an avaiable stream from content.

Assuming that file is available in the content directory of the VHost, the file should now start playing. Try pausing and seeking.

The events should now be recorded in the database. Use any database analysis tool to query the database.

  • No labels