Collect stats locally or send to service via request

This is a very basic statistics module that will allow you to save connection/bandwidth information to file and/or send it to a remote server for collection into a database or otherwise.

In your Server.xml file, you can setup the listener as follows under Root/Server/ServerListeners:


These are the following available properties:

<!-- Time to wait between collection attempts -->
<Property> <Name>twgStatsWaitTime</Name> <Value>8000</Value> <Type>Integer</Type> </Property>
<!-- URL to send GET request for stats relay -->
<Property> <Name>twgStatsURL</Name> <Value>http://[ip-address]:[port]/stats.php</Value> <Type>String</Type> </Property>
<!-- IP address of given server -->
<Property> <Name>twgStatsIP</Name> <Value>[ip-address]</Value> <Type>String</Type> </Property>
<!-- Debug mode true|false -->
<Property> <Name>twgStatsDebug</Name> <Value>true</Value> <Type>Boolean</Type> </Property>
<!-- Enable logging of stats to file -->
<Property> <Name>twgStatsLogToFile</Name> <Value>true</Value> <Type>Boolean</Type>v </Property>
<!-- FilePath to .txt file that the stats should be saved (if locally opted) -->
<Property> <Name>twgStatsLogDirectory</Name> <Value>/usr/local/WowzaStreamingEngine/logs/streamstats.txt</Value> <Type>String</Type> </Property>

Download the complete source and jar file here.

Comments are closed.