Present in the Next release. See the related bug
The current statistics of the FreeCast network can be retrieved in XML format.
Statistics are available at this URL http://<tracker host>:<tracker port>/stats.xml. Add ?networkid=<id> to retrieve the statistics of a specific network.
This returned xml file is compatible with icecast specifications.
Examples: http://localhost:1665/stats.xml, http://localhost:1665/stats.xml?networkid=4e925fa33
Several consumers can be configured.
Add a line for each network to a given text file.
Each line uses a configurable pattern. The default one is {0,date,yyyyMMdd-HHmmss} {1} {2} {3} {4} {5}. The arguments are :
With the default pattern, the consumer produces something like :
20061007-205638 489ab78 1 1 0 true 20061007-205738 489ab78 2 1 1 true 20061007-205738 489ab78 5 1 4 true
Execute a given command for each network. The command arguments are the following:
true or false according to the root node is present or notA working directory can be specified into the configuration.
For example, the following configuration :
... <consumer> <class>exec</class> <command>/etc/freecast/update_rddtools</command> <workingdir>/var/lib/freecast</workingdir> </consumer> ...
leads the tracker to execute this kind of command /etc/freecast/update_rddtools 1160247699 983a8e 2 1 1 true
Executes a given SQL request for each network statistics. Requires the needed JDBC driver.
The default request is :
INSERT INTO statistics (timestamp,networkid,node_connections,rootnode_connections,listeners,rootnode) VALUES (?,?,?,?,?,?);
The request paramters must be :
Under Mysql, a simple statistics table can be created with :
CREATE TABLE statistics ( timestamp DATETIME, networkid VARCHAR(50), node_connections INT, rootnode_connections INT, listeners INT, rootnode BIT )
There is a full/complete configuration example.
<freecast> <tracker> <statistics> <xml>true</xml> <!-- unable the XML statistics, by default: true --> <update>60</update> <!-- the delay in seconds between statistics update, by default: 60 --> <consumer> <!-- execute the given command --> <class>exec</class> <command>/etc/freecast/update_rrdtools</command> <workingdir>/var/lib/freecast</workingdir> <!-- optionnal --> </consumer> <consumer> <!-- append statistics to --> <class>file</class> <file>/var/log/freecast/statistics.log</file> </consumer> <consumer> <!-- update the given database --> <class>database</class> <driver>com.mysql.jdbc.Driver</driver> <url>jdbc:mysql://localhost:3306/myfreecast?autoreconnect=true</url> <user>root</user> <password>p@ssword</password> <request> <!-- defines the SQL request to be executed, by default : this string --> insert into statistics (timestamp,networkid,node_connections,rootnode_connections,listeners,rootnode) values (?,?,?,?,?,?); </request> </consumer> </statistics> </tracker> </freecast>