mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Update server stat for cid
This commit is contained in:
parent
102434b3d5
commit
a43f339aa6
2 changed files with 16 additions and 2 deletions
|
@ -53,6 +53,9 @@ extern SrsPps* _srs_pps_ids;
|
||||||
extern SrsPps* _srs_pps_fids;
|
extern SrsPps* _srs_pps_fids;
|
||||||
extern SrsPps* _srs_pps_fids_level0;
|
extern SrsPps* _srs_pps_fids_level0;
|
||||||
|
|
||||||
|
extern SrsPps* _srs_pps_cids_get;
|
||||||
|
extern SrsPps* _srs_pps_cids_set;
|
||||||
|
|
||||||
SrsRtcBlackhole::SrsRtcBlackhole()
|
SrsRtcBlackhole::SrsRtcBlackhole()
|
||||||
{
|
{
|
||||||
blackhole = false;
|
blackhole = false;
|
||||||
|
@ -649,12 +652,14 @@ srs_error_t SrsRtcServer::notify(int type, srs_utime_t interval, srs_utime_t tic
|
||||||
// Update the pps stat for UDP socket and adddresses.
|
// Update the pps stat for UDP socket and adddresses.
|
||||||
_srs_pps_pkts->update(); _srs_pps_addrs->update(); _srs_pps_fast_addrs->update();
|
_srs_pps_pkts->update(); _srs_pps_addrs->update(); _srs_pps_fast_addrs->update();
|
||||||
_srs_pps_ids->update(); _srs_pps_fids->update(); _srs_pps_fids_level0->update();
|
_srs_pps_ids->update(); _srs_pps_fids->update(); _srs_pps_fids_level0->update();
|
||||||
|
_srs_pps_cids_get->update(); _srs_pps_cids_set->update();
|
||||||
|
|
||||||
// TODO: FIXME: Show more data for RTC server.
|
// TODO: FIXME: Show more data for RTC server.
|
||||||
srs_trace("RTC: Server conns=%u, cpu=%.2f%%, rss=%dMB, pkts=%d, addrs=%d,%d, fid=%d,%d,%d",
|
srs_trace("RTC: Server conns=%u, cpu=%.2f%%, rss=%dMB, pkts=%d, addrs=%d,%d, fid=%d,%d,%d, cid=%d,%d",
|
||||||
nn_rtc_conns, u->percent * 100, memory,
|
nn_rtc_conns, u->percent * 100, memory,
|
||||||
_srs_pps_pkts->r10s(), _srs_pps_addrs->r10s(), _srs_pps_fast_addrs->r10s(),
|
_srs_pps_pkts->r10s(), _srs_pps_addrs->r10s(), _srs_pps_fast_addrs->r10s(),
|
||||||
_srs_pps_ids->r10s(), _srs_pps_fids->r10s(), _srs_pps_fids_level0->r10s()
|
_srs_pps_ids->r10s(), _srs_pps_fids->r10s(), _srs_pps_fids_level0->r10s(),
|
||||||
|
_srs_pps_cids_get->r10s(), _srs_pps_cids_set->r10s()
|
||||||
);
|
);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -33,6 +33,11 @@ using namespace std;
|
||||||
#include <srs_kernel_utility.hpp>
|
#include <srs_kernel_utility.hpp>
|
||||||
#include <srs_protocol_utility.hpp>
|
#include <srs_protocol_utility.hpp>
|
||||||
|
|
||||||
|
#include <srs_protocol_kbps.hpp>
|
||||||
|
|
||||||
|
SrsPps* _srs_pps_cids_get = new SrsPps(_srs_clock);
|
||||||
|
SrsPps* _srs_pps_cids_set = new SrsPps(_srs_clock);
|
||||||
|
|
||||||
#define SRS_BASIC_LOG_SIZE 8192
|
#define SRS_BASIC_LOG_SIZE 8192
|
||||||
|
|
||||||
SrsThreadContext::SrsThreadContext()
|
SrsThreadContext::SrsThreadContext()
|
||||||
|
@ -59,6 +64,8 @@ void _srs_context_destructor(void* arg)
|
||||||
|
|
||||||
const SrsContextId& SrsThreadContext::get_id()
|
const SrsContextId& SrsThreadContext::get_id()
|
||||||
{
|
{
|
||||||
|
++_srs_pps_cids_get->sugar;
|
||||||
|
|
||||||
if (!srs_thread_self()) {
|
if (!srs_thread_self()) {
|
||||||
return _srs_context_default;
|
return _srs_context_default;
|
||||||
}
|
}
|
||||||
|
@ -73,6 +80,8 @@ const SrsContextId& SrsThreadContext::get_id()
|
||||||
|
|
||||||
const SrsContextId& SrsThreadContext::set_id(const SrsContextId& v)
|
const SrsContextId& SrsThreadContext::set_id(const SrsContextId& v)
|
||||||
{
|
{
|
||||||
|
++_srs_pps_cids_set->sugar;
|
||||||
|
|
||||||
if (!srs_thread_self()) {
|
if (!srs_thread_self()) {
|
||||||
_srs_context_default = v;
|
_srs_context_default = v;
|
||||||
return v;
|
return v;
|
||||||
|
|
Loading…
Reference in a new issue