mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add nb_streams for vhost
This commit is contained in:
parent
6e5143449e
commit
baa70d4ddd
2 changed files with 7 additions and 0 deletions
6
trunk/src/app/srs_app_statistic.cpp
Executable file → Normal file
6
trunk/src/app/srs_app_statistic.cpp
Executable file → Normal file
|
@ -49,6 +49,7 @@ SrsStatisticVhost::SrsStatisticVhost()
|
||||||
kbps->set_io(NULL, NULL);
|
kbps->set_io(NULL, NULL);
|
||||||
|
|
||||||
nb_clients = 0;
|
nb_clients = 0;
|
||||||
|
nb_streams = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsStatisticVhost::~SrsStatisticVhost()
|
SrsStatisticVhost::~SrsStatisticVhost()
|
||||||
|
@ -69,6 +70,7 @@ int SrsStatisticVhost::dumps(stringstream& ss)
|
||||||
<< SRS_JFIELD_STR("name", vhost) << SRS_JFIELD_CONT
|
<< SRS_JFIELD_STR("name", vhost) << SRS_JFIELD_CONT
|
||||||
<< SRS_JFIELD_BOOL("enabled", enabled) << SRS_JFIELD_CONT
|
<< SRS_JFIELD_BOOL("enabled", enabled) << SRS_JFIELD_CONT
|
||||||
<< SRS_JFIELD_ORG("clients", nb_clients) << SRS_JFIELD_CONT
|
<< SRS_JFIELD_ORG("clients", nb_clients) << SRS_JFIELD_CONT
|
||||||
|
<< SRS_JFIELD_ORG("streams", nb_streams) << SRS_JFIELD_CONT
|
||||||
<< SRS_JFIELD_ORG("send_bytes", kbps->get_send_bytes()) << SRS_JFIELD_CONT
|
<< SRS_JFIELD_ORG("send_bytes", kbps->get_send_bytes()) << SRS_JFIELD_CONT
|
||||||
<< SRS_JFIELD_ORG("recv_bytes", kbps->get_recv_bytes()) << SRS_JFIELD_CONT
|
<< SRS_JFIELD_ORG("recv_bytes", kbps->get_recv_bytes()) << SRS_JFIELD_CONT
|
||||||
<< SRS_JFIELD_OBJ("kbps")
|
<< SRS_JFIELD_OBJ("kbps")
|
||||||
|
@ -169,6 +171,8 @@ void SrsStatisticStream::publish(int cid)
|
||||||
{
|
{
|
||||||
connection_cid = cid;
|
connection_cid = cid;
|
||||||
active = true;
|
active = true;
|
||||||
|
|
||||||
|
vhost->nb_streams++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsStatisticStream::close()
|
void SrsStatisticStream::close()
|
||||||
|
@ -176,6 +180,8 @@ void SrsStatisticStream::close()
|
||||||
has_video = false;
|
has_video = false;
|
||||||
has_audio = false;
|
has_audio = false;
|
||||||
active = false;
|
active = false;
|
||||||
|
|
||||||
|
vhost->nb_streams--;
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsStatisticClient::SrsStatisticClient()
|
SrsStatisticClient::SrsStatisticClient()
|
||||||
|
|
1
trunk/src/app/srs_app_statistic.hpp
Executable file → Normal file
1
trunk/src/app/srs_app_statistic.hpp
Executable file → Normal file
|
@ -45,6 +45,7 @@ struct SrsStatisticVhost
|
||||||
public:
|
public:
|
||||||
int64_t id;
|
int64_t id;
|
||||||
std::string vhost;
|
std::string vhost;
|
||||||
|
int nb_streams;
|
||||||
int nb_clients;
|
int nb_clients;
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue