added client id to stat

This commit is contained in:
Roman Arutyunyan 2012-11-23 14:54:21 +04:00
parent fa3e5a35c1
commit ebca0917a4
2 changed files with 10 additions and 4 deletions

View file

@ -337,19 +337,23 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll,
#ifdef NGX_RTMP_POOL_DEBUG
ngx_rtmp_stat_dump_pool(r, lll, s->connection->pool);
#endif
NGX_RTMP_STAT_L("<id>");
NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf), "%ui",
(ngx_uint_t) s->connection->number)
- buf);
NGX_RTMP_STAT_L("</id>");
NGX_RTMP_STAT_L("<address>");
NGX_RTMP_STAT_S(&s->connection->addr_text);
NGX_RTMP_STAT_L("</address>");
NGX_RTMP_STAT_L("<time>");
NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf),
"%M", ngx_current_msec - s->epoch) - buf);
NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf), "%M",
ngx_current_msec - s->epoch)
- buf);
NGX_RTMP_STAT_L("</time>");
NGX_RTMP_STAT_L("<dropped>");
/*NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf),
"%uz", ctx->ndropped) - buf);*/
NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf),
"%uD/%uD", ctx->cs[1].dropped,
ctx->cs[0].dropped) - buf);

View file

@ -125,6 +125,7 @@
<td colspan="12" ngcolor="#eeeeee">
<table cellspacing="1" cellpadding="5">
<tr>
<th>Id</th>
<th>State</th>
<th>Address</th>
<th>Flash version</th>
@ -187,6 +188,7 @@
<xsl:otherwise>#eeeeee</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td><xsl:value-of select="id"/></td>
<td><xsl:call-template name="clientstate"/></td>
<td><xsl:value-of select="address"/></td>
<td><xsl:value-of select="flashver"/></td>