You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
APPLICATION: When using http-flv playback, the traffic statistics are incorrect when calling the srs http api. However, the client connection count is accurate.
#863
Closed
xialixin opened this issue
Apr 28, 2017
· 5 comments
When using http-flv for playback, the traffic statistics are incorrect. The parameters send_bytes and kbps.send_30s do not increase even after a certain number, but the client connection is correct. I have checked the SRS code and found that the statistics code is present in the http-flv related code.
int SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
{ ...
// update the statistic when source disconveried.
SrsStatistic* stat = SrsStatistic::instance();
if ((ret = stat->on_client(_srs_context->get_id(), req, NULL, SrsRtmpConnPlay)) != ERROR_SUCCESS) {
srs_error("stat client failed. ret=%d", ret);
return ret;
}
...
}
Continuing to track the code, the relevant traffic statistics code in SrsHttpConn is as follows:
void SrsHttpConn::resample()
{
// TODO: FIXME: implements it
}
int64_t SrsHttpConn::get_send_bytes_delta()
{
// TODO: FIXME: implements it
return 0;
}
int64_t SrsHttpConn::get_recv_bytes_delta()
{
// TODO: FIXME: implements it
return 0;
}
void SrsHttpConn::cleanup()
{
// TODO: FIXME: implements it
}
SrsHttpConn and SrsRtmpConn are both derived from the base class SrsConnection. In the SrsConnection class, the SrsKbps is called. To verify if it is related to the above code, simply modify the above code as follows, calling the relevant methods in the base class SrsConnection.
After recompiling, start SRS and then use the API to view the relevant parameters. The parameters send_bytes and kbps.send_30s keep increasing.
The above is the issue discovered during the testing process and is presented here for everyone's reference.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered:
winlinvip
changed the title
http-flv流量统计问题:当使用http-flv播放时,调用srs http api查看流量统计不对,客户端连接数是对的
APPLICATION: 当使用http-flv播放时,调用srs http api查看流量统计不对,客户端连接数是对的
Apr 30, 2017
winlinvip
changed the title
APPLICATION: 当使用http-flv播放时,调用srs http api查看流量统计不对,客户端连接数是对的
APPLICATION: When using http-flv playback, the traffic statistics are incorrect when calling the srs http api. However, the client connection count is accurate.
Jul 28, 2023
When using http-flv for playback, the traffic statistics are incorrect. The parameters send_bytes and kbps.send_30s do not increase even after a certain number, but the client connection is correct. I have checked the SRS code and found that the statistics code is present in the http-flv related code.
Continuing to track the code, the relevant traffic statistics code in SrsHttpConn is as follows:
SrsHttpConn and SrsRtmpConn are both derived from the base class SrsConnection. In the SrsConnection class, the SrsKbps is called. To verify if it is related to the above code, simply modify the above code as follows, calling the relevant methods in the base class SrsConnection.
After recompiling, start SRS and then use the API to view the relevant parameters. The parameters send_bytes and kbps.send_30s keep increasing.
The above is the issue discovered during the testing process and is presented here for everyone's reference.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: