正在显示
2 个修改的文件
包含
7 行增加
和
0 行删除
trunk/src/app/srs_app_statistic.cpp
100755 → 100644
| @@ -49,6 +49,7 @@ SrsStatisticVhost::SrsStatisticVhost() | @@ -49,6 +49,7 @@ SrsStatisticVhost::SrsStatisticVhost() | ||
| 49 | kbps->set_io(NULL, NULL); | 49 | kbps->set_io(NULL, NULL); |
| 50 | 50 | ||
| 51 | nb_clients = 0; | 51 | nb_clients = 0; |
| 52 | + nb_streams = 0; | ||
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | SrsStatisticVhost::~SrsStatisticVhost() | 55 | SrsStatisticVhost::~SrsStatisticVhost() |
| @@ -69,6 +70,7 @@ int SrsStatisticVhost::dumps(stringstream& ss) | @@ -69,6 +70,7 @@ int SrsStatisticVhost::dumps(stringstream& ss) | ||
| 69 | << SRS_JFIELD_STR("name", vhost) << SRS_JFIELD_CONT | 70 | << SRS_JFIELD_STR("name", vhost) << SRS_JFIELD_CONT |
| 70 | << SRS_JFIELD_BOOL("enabled", enabled) << SRS_JFIELD_CONT | 71 | << SRS_JFIELD_BOOL("enabled", enabled) << SRS_JFIELD_CONT |
| 71 | << SRS_JFIELD_ORG("clients", nb_clients) << SRS_JFIELD_CONT | 72 | << SRS_JFIELD_ORG("clients", nb_clients) << SRS_JFIELD_CONT |
| 73 | + << SRS_JFIELD_ORG("streams", nb_streams) << SRS_JFIELD_CONT | ||
| 72 | << SRS_JFIELD_ORG("send_bytes", kbps->get_send_bytes()) << SRS_JFIELD_CONT | 74 | << SRS_JFIELD_ORG("send_bytes", kbps->get_send_bytes()) << SRS_JFIELD_CONT |
| 73 | << SRS_JFIELD_ORG("recv_bytes", kbps->get_recv_bytes()) << SRS_JFIELD_CONT | 75 | << SRS_JFIELD_ORG("recv_bytes", kbps->get_recv_bytes()) << SRS_JFIELD_CONT |
| 74 | << SRS_JFIELD_OBJ("kbps") | 76 | << SRS_JFIELD_OBJ("kbps") |
| @@ -169,6 +171,8 @@ void SrsStatisticStream::publish(int cid) | @@ -169,6 +171,8 @@ void SrsStatisticStream::publish(int cid) | ||
| 169 | { | 171 | { |
| 170 | connection_cid = cid; | 172 | connection_cid = cid; |
| 171 | active = true; | 173 | active = true; |
| 174 | + | ||
| 175 | + vhost->nb_streams++; | ||
| 172 | } | 176 | } |
| 173 | 177 | ||
| 174 | void SrsStatisticStream::close() | 178 | void SrsStatisticStream::close() |
| @@ -176,6 +180,8 @@ void SrsStatisticStream::close() | @@ -176,6 +180,8 @@ void SrsStatisticStream::close() | ||
| 176 | has_video = false; | 180 | has_video = false; |
| 177 | has_audio = false; | 181 | has_audio = false; |
| 178 | active = false; | 182 | active = false; |
| 183 | + | ||
| 184 | + vhost->nb_streams--; | ||
| 179 | } | 185 | } |
| 180 | 186 | ||
| 181 | SrsStatisticClient::SrsStatisticClient() | 187 | SrsStatisticClient::SrsStatisticClient() |
trunk/src/app/srs_app_statistic.hpp
100755 → 100644
-
请 注册 或 登录 后发表评论