Mcstat listens to multicast traffic and outputs simple statistics. For each channel it measures:
- throughput (KB/s),
- UDP packets (per second).
The output is written periodically to stdout or database (or both).
Mcstat currently reads channels from database once, so if the channel configuration changes, then mcstat should be restarted.
- Python 2 and Setuptools are required for installation.
- VLC is optional - for smoke testing the installation.
- PostgreSQL database and psycopg2 are required for writing statistics to database (PostgreSQL is the only database supported.)
To install in $HOME/.local/ run:
cd src
python2 ./setup.py install --user
Then add mcstat to PATH, for example like this:
PATH=$PATH:$HOME/.local/bin
Mcstat can also be installed globally, or in a virtual environment -- just like any other Python package.
To smoke test the installation get a sample TS file and stream it with VLC:
cvlc MY_STREAM.ts --loop --sout '#standard{access=udp,dst=239.0.0.2:1234}'
Then in another console run mcstat:
mcstat 239.0.0.2:1234
This will print statistics of a single channel to stdout.
Then stop mcstat with Ctrl-C.
Copy and customize the configuration file:
cp mcstat.conf SOME_PATH/
vim SOME_PATH/mcstat.conf
All configuration parameters are explained in the config file.
To run mcstat:
mcstat -c SOME_PATH/mcstat.conf
To see help on commandline parameters:
mcstat --help