added naccepted value to stat

This commit is contained in:
Roman Arutyunyan 2013-02-02 22:18:19 +04:00
parent c514c9f715
commit f4b29b0547
5 changed files with 14 additions and 1 deletions

View file

@ -577,6 +577,9 @@ extern ngx_rtmp_bandwidth_t ngx_rtmp_bw_out;
extern ngx_rtmp_bandwidth_t ngx_rtmp_bw_in;
extern ngx_uint_t ngx_rtmp_naccepted;
extern ngx_uint_t ngx_rtmp_max_module;
extern ngx_module_t ngx_rtmp_core_module;

View file

@ -13,6 +13,9 @@ static void ngx_rtmp_ping(ngx_event_t *rev);
static ngx_int_t ngx_rtmp_finalize_set_chunk_size(ngx_rtmp_session_t *s);
ngx_uint_t ngx_rtmp_naccepted;
ngx_rtmp_bandwidth_t ngx_rtmp_bw_out;
ngx_rtmp_bandwidth_t ngx_rtmp_bw_in;

View file

@ -26,6 +26,7 @@ ngx_rtmp_init_connection(ngx_connection_t *c)
ngx_rtmp_in6_addr_t *addr6;
#endif
++ngx_rtmp_naccepted;
/* find the server configuration for the address:port */

View file

@ -578,6 +578,11 @@ ngx_rtmp_stat_handler(ngx_http_request_t *r)
"%T", ngx_cached_time->sec - start_time) - tbuf);
NGX_RTMP_STAT_L("</uptime>\r\n");
NGX_RTMP_STAT_L("<naccepted>");
NGX_RTMP_STAT(nbuf, ngx_snprintf(nbuf, sizeof(nbuf),
"%ui", ngx_rtmp_naccepted) - nbuf);
NGX_RTMP_STAT_L("</naccepted>\r\n");
ngx_rtmp_stat_bw(r, lll, &ngx_rtmp_bw_in, &ngx_rtmp_bw_out);
cscf = cmcf->servers.elts;

View file

@ -36,7 +36,8 @@
<th>Time</th>
</tr>
<tr>
<td colspan="2"/>
<td>@<xsl:value-of select="naccepted"/></td>
<td/>
<td><xsl:value-of select="in"/></td>
<td><xsl:value-of select="out"/></td>
<td><xsl:value-of select="round(bwin div 1024)"/></td>