mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
Perf: Stat the shared messages.
This commit is contained in:
parent
bffe9c5f4b
commit
d6c0117870
2 changed files with 10 additions and 3 deletions
|
@ -79,6 +79,7 @@ extern SrsPps* _srs_pps_objs_rtps;
|
|||
extern SrsPps* _srs_pps_objs_rraw;
|
||||
extern SrsPps* _srs_pps_objs_rfua;
|
||||
extern SrsPps* _srs_pps_objs_rbuf;
|
||||
extern SrsPps* _srs_pps_objs_msgs;
|
||||
|
||||
SrsRtcBlackhole::SrsRtcBlackhole()
|
||||
{
|
||||
|
@ -690,9 +691,9 @@ srs_error_t SrsRtcServer::notify(int type, srs_utime_t interval, srs_utime_t tic
|
|||
static char buf[128];
|
||||
|
||||
string objs_desc;
|
||||
_srs_pps_objs_rtps->update(); _srs_pps_objs_rraw->update(); _srs_pps_objs_rfua->update(); _srs_pps_objs_rbuf->update();
|
||||
if (_srs_pps_objs_rtps->r10s() || _srs_pps_objs_rraw->r10s() || _srs_pps_objs_rfua->r10s() || _srs_pps_objs_rbuf->r10s()) {
|
||||
snprintf(buf, sizeof(buf), ", objs=%d,%d,%d,%d", _srs_pps_objs_rtps->r10s(), _srs_pps_objs_rraw->r10s(), _srs_pps_objs_rfua->r10s(), _srs_pps_objs_rbuf->r10s());
|
||||
_srs_pps_objs_rtps->update(); _srs_pps_objs_rraw->update(); _srs_pps_objs_rfua->update(); _srs_pps_objs_rbuf->update(); _srs_pps_objs_msgs->update();
|
||||
if (_srs_pps_objs_rtps->r10s() || _srs_pps_objs_rraw->r10s() || _srs_pps_objs_rfua->r10s() || _srs_pps_objs_rbuf->r10s() || _srs_pps_objs_msgs->r10s()) {
|
||||
snprintf(buf, sizeof(buf), ", objs=%d,%d,%d,%d,%d", _srs_pps_objs_rtps->r10s(), _srs_pps_objs_rraw->r10s(), _srs_pps_objs_rfua->r10s(), _srs_pps_objs_rbuf->r10s(), _srs_pps_objs_msgs->r10s());
|
||||
objs_desc = buf;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,10 @@ using namespace std;
|
|||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_core_autofree.hpp>
|
||||
|
||||
#include <srs_kernel_kbps.hpp>
|
||||
|
||||
SrsPps* _srs_pps_objs_msgs = new SrsPps();
|
||||
|
||||
SrsMessageHeader::SrsMessageHeader()
|
||||
{
|
||||
message_type = 0;
|
||||
|
@ -209,6 +213,8 @@ SrsSharedPtrMessage::SrsSharedPtrPayload::~SrsSharedPtrPayload()
|
|||
SrsSharedPtrMessage::SrsSharedPtrMessage() : timestamp(0), stream_id(0), size(0), payload(NULL)
|
||||
{
|
||||
ptr = NULL;
|
||||
|
||||
++ _srs_pps_objs_msgs->sugar;
|
||||
}
|
||||
|
||||
SrsSharedPtrMessage::~SrsSharedPtrMessage()
|
||||
|
|
Loading…
Reference in a new issue