Add in/out traffice per client (because <play> has no information about traffic itself)

This commit is contained in:
Alexey Plotnik 2014-09-22 00:51:09 +11:00
parent 5fb4c99ca9
commit d99c069e8e

View file

@ -364,6 +364,14 @@ ngx_rtmp_stat_client(ngx_http_request_t *r, ngx_chain_t ***lll,
NGX_RTMP_STAT_ES(&s->swf_url);
NGX_RTMP_STAT_L("</swfurl>");
}
NGX_RTMP_STAT_L("<bytes_in>");
NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf), "%ui", (ngx_uint_t) s->in_bytes) - buf);
NGX_RTMP_STAT_L("</bytes_in>");
NGX_RTMP_STAT_L("<bytes_out>");
NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf), "%ui", (ngx_uint_t) s->out_bytes) - buf);
NGX_RTMP_STAT_L("</bytes_out>");
}