Track how many active encoders you have running at a time on the PandaStream.com service.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
lib
public/stylesheets
tests
.gitignore
Gemfile
Gemfile.lock
License.txt
README.markdown
config.ru
pandastream_stats_app.rb

README.markdown

WHAT

A small sinatra web app to feed up data on how many PandaStream encoders you have running at a time. The app works by fetching data via the Panda API at intervals (probably triggered via a cron job) and counting the number of encodings marked "processing" at that moment. Note this is a rough count, so you'll need to run the check frequently enough to avoid spikes in data (but not so frequently to annoy the stellar NewBamboo guys).

The stats page will highlight results green/orange/red based on the nearness of the number of encoders to your configured max.

USAGE

CONFIG

Copy the config/config-example.yml and populate it with your Panda API settings, as well as the number of encoders you typically run.

The Web App

The sinatra app provides the following functionality:

  • get "/" - See recent stats
  • get "/average" - See the average number of encoders running based on your stats
  • get "/max" - See the maximum number of encoders running from your stats
  • put "/" - trigger a stat update by fetching data from Panda API

Configuring Polling

TODO

WHY

I couldn't find a way to average out how many encoders we had running at a time on the PandaStream service. I figured we could poll their API at intervals and store how many encodings were marked "processing" to keep rough stats.

MISC

I'm in no way affiliated with NewBamboo or PandaStream, other than being a happy consumer of their service.

AUTHORS

CREDITS

Thanks to the KajabiApp.com team for allowing this to be opensourced.

TODO

  • Add a cron to update from panda
  • Add basic user/pass protection
  • Write usage
  • Better config on the database setup, esp. for heroku capability
  • Rakefile the tests