mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add client num for stream in statistic
This commit is contained in:
parent
08e9f6ef42
commit
46d716612c
3 changed files with 16 additions and 40 deletions
|
@ -200,6 +200,7 @@ int SrsRtmpConn::do_cycle()
|
|||
|
||||
ret = service_cycle();
|
||||
http_hooks_on_close();
|
||||
SrsStatistic::instance()->on_close(_srs_context->get_id());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -398,8 +399,7 @@ int SrsRtmpConn::stream_service_cycle()
|
|||
|
||||
// update the statistic when source disconveried.
|
||||
SrsStatistic* stat = SrsStatistic::instance();
|
||||
int client_id = _srs_context->get_id();
|
||||
if ((ret = stat->on_client(client_id, req)) != ERROR_SUCCESS) {
|
||||
if ((ret = stat->on_client(_srs_context->get_id(), req)) != ERROR_SUCCESS) {
|
||||
srs_error("stat client failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -446,15 +446,9 @@ int SrsRtmpConn::stream_service_cycle()
|
|||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = stat->on_client_play_start(client_id)) != ERROR_SUCCESS) {
|
||||
srs_error("stat client play start failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
srs_info("start to play stream %s success", req->stream.c_str());
|
||||
ret = playing(source);
|
||||
http_hooks_on_stop();
|
||||
stat->on_client_play_stop(client_id);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue