[asterisk-commits] dlee: trunk r386624 - in /trunk: configs/ include/asterisk/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 26 15:05:27 CDT 2013


Author: dlee
Date: Fri Apr 26 15:05:15 2013
New Revision: 386624

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386624
Log:
Example of how to use the Stasis message bus

In order to get people familiar with the Stasis message bus, it would
be useful to have something of a tutorial. Since I'm not clever enough
to think of some cool integration we could do with Twitter, I settled
for something that might actually be useful.

This patch adds a res_statsd.so module, which implements a basic
statsd[1] client. Statsd is a very simple statistics gathering server,
which can publish its results to a backend graphing engine, like
Graphite[2]. There are several different Statsd server
implementations[3], so you can pick what works best for your
environment.

The actual example of how to use the Stasis message bus is in
res_chan_stats.so. This module demonstrates how to use subscriptions
and the message router by monitoring messages and posting channels
stats to the statsd server.

A wiki page walking through res_chan_stats.so is forthcoming.

 [1]: https://github.com/etsy/statsd/
 [2]: http://graphite.readthedocs.org/en/latest/
 [3]: http://joemiller.me/2011/09/21/list-of-statsd-server-implementations/

Review: https://reviewboard.asterisk.org/r/2460/

Added:
    trunk/configs/statsd.conf.sample
      - copied unchanged from r386623, team/dlee/stasis-demo/configs/statsd.conf.sample
    trunk/include/asterisk/statsd.h
      - copied unchanged from r386623, team/dlee/stasis-demo/include/asterisk/statsd.h
    trunk/res/res_chan_stats.c
      - copied unchanged from r386623, team/dlee/stasis-demo/res/res_chan_stats.c
    trunk/res/res_statsd.c
      - copied unchanged from r386623, team/dlee/stasis-demo/res/res_statsd.c
    trunk/res/res_statsd.exports.in
      - copied unchanged from r386623, team/dlee/stasis-demo/res/res_statsd.exports.in
Modified:
    trunk/include/asterisk/utils.h

Modified: trunk/include/asterisk/utils.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/utils.h?view=diff&rev=386624&r1=386623&r2=386624
==============================================================================
--- trunk/include/asterisk/utils.h (original)
+++ trunk/include/asterisk/utils.h Fri Apr 26 15:05:15 2013
@@ -458,6 +458,11 @@
 
 long int ast_random(void);
 
+/*!
+ * \brief Returns a random number between 0.0 and 1.0, inclusive.
+ * \since 12
+ */
+#define ast_random_double() (((double)ast_random()) / RAND_MAX)
 
 /*!
  * \brief free() wrapper




More information about the asterisk-commits mailing list