<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13652">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Benjamin Keith Ford: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_statsd: Document that res_statsd does nothing on its own<br><br>ASTERISK-24484 #close<br>Reported by: Dan Jenkins<br><br>Change-Id: I05f298904511d6739aefb1486b6fcbee27efa9ec<br>---<br>M res/res_statsd.c<br>1 file changed, 24 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_statsd.c b/res/res_statsd.c</span><br><span>index 01a1fd8..bdb3d6f 100644</span><br><span>--- a/res/res_statsd.c</span><br><span>+++ b/res/res_statsd.c</span><br><span>@@ -17,7 +17,7 @@</span><br><span> */</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Support for publishing to a statsd server.</span><br><span style="color: hsl(120, 100%, 40%);">+ * \brief Support for publishing to a StatsD server.</span><br><span> *</span><br><span> * \author David M. Lee, II <dlee@digium.com></span><br><span> * \since 12</span><br><span>@@ -29,21 +29,34 @@</span><br><span> </span><br><span> /*** DOCUMENTATION</span><br><span> <configInfo name="res_statsd" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis>Statsd client.</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ <synopsis>StatsD client</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ <description></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>The <literal>res_statsd</literal> module provides an API that</span><br><span style="color: hsl(120, 100%, 40%);">+ allows Asterisk and its modules to send statistics to a StatsD</span><br><span style="color: hsl(120, 100%, 40%);">+ server. It only provides a means to communicate with a StatsD server</span><br><span style="color: hsl(120, 100%, 40%);">+ and does not send any metrics of its own.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>An example module, <literal>res_chan_stats</literal>, is</span><br><span style="color: hsl(120, 100%, 40%);">+ provided which uses the API exposed by this module to send channel</span><br><span style="color: hsl(120, 100%, 40%);">+ statistics to the configured StatsD server.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>More information about StatsD can be found at</span><br><span style="color: hsl(120, 100%, 40%);">+ https://github.com/statsd/statsd</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </description></span><br><span> <configFile name="statsd.conf"></span><br><span> <configObject name="global"></span><br><span> <synopsis>Global configuration settings</synopsis></span><br><span> <configOption name="enabled"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis>Enable/disable the statsd module</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ <synopsis>Enable/disable the StatsD module</synopsis></span><br><span> </configOption></span><br><span> <configOption name="server"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis>Address of the statsd server</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ <synopsis>Address of the StatsD server</synopsis></span><br><span> </configOption></span><br><span> <configOption name="prefix"></span><br><span> <synopsis>Prefix to prepend to every metric</synopsis></span><br><span> </configOption></span><br><span> <configOption name="add_newline"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis>Append a newline to every event. This is useful if you want to fake out a server using netcat (nc -lu 8125)</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ <synopsis>Append a newline to every event. This is useful if</span><br><span style="color: hsl(120, 100%, 40%);">+ you want to fake out a server using netcat</span><br><span style="color: hsl(120, 100%, 40%);">+ (nc -lu 8125)</synopsis></span><br><span> </configOption></span><br><span> </configObject></span><br><span> </configFile></span><br><span>@@ -286,13 +299,13 @@</span><br><span> </span><br><span> ast_assert(is_enabled());</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(3, "Configuring statsd client.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(3, "Configuring StatsD client.\n");</span><br><span> </span><br><span> if (socket_fd == -1) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(3, "Creating statsd socket.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(3, "Creating StatsD socket.\n");</span><br><span> socket_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);</span><br><span> if (socket_fd == -1) {</span><br><span style="color: hsl(0, 100%, 40%);">- perror("Error creating statsd socket");</span><br><span style="color: hsl(120, 100%, 40%);">+ perror("Error creating StatsD socket");</span><br><span> return -1;</span><br><span> }</span><br><span> }</span><br><span>@@ -300,7 +313,7 @@</span><br><span> conf_server(cfg, &statsd_server);</span><br><span> server = ast_sockaddr_stringify_fmt(&statsd_server,</span><br><span> AST_SOCKADDR_STR_DEFAULT);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(3, " statsd server = %s.\n", server);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(3, " StatsD server = %s.\n", server);</span><br><span> ast_debug(3, " add newline = %s\n", AST_YESNO(cfg->global->add_newline));</span><br><span> ast_debug(3, " prefix = %s\n", cfg->global->prefix);</span><br><span> </span><br><span>@@ -309,7 +322,7 @@</span><br><span> </span><br><span> static void statsd_shutdown(void)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(3, "Shutting down statsd client.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(3, "Shutting down StatsD client.\n");</span><br><span> if (socket_fd != -1) {</span><br><span> close(socket_fd);</span><br><span> socket_fd = -1;</span><br><span>@@ -405,7 +418,7 @@</span><br><span> /* The priority of this module is set just after realtime, since it loads</span><br><span> * configuration and could be used by any other sort of module.</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "Statsd client support",</span><br><span style="color: hsl(120, 100%, 40%);">+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "StatsD client support",</span><br><span> .support_level = AST_MODULE_SUPPORT_EXTENDED,</span><br><span> .load = load_module,</span><br><span> .unload = unload_module,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13652">change 13652</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/13652"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I05f298904511d6739aefb1486b6fcbee27efa9ec </div>
<div style="display:none"> Gerrit-Change-Number: 13652 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-CC: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>