RTC: Refine stat logs

pull/2213/head
winlin 4 years ago
parent 3c1738b60e
commit 243100817a

@ -61,7 +61,6 @@ using namespace std;
#include <srs_protocol_kbps.hpp>
SrsPps* _srs_pps_sstuns = new SrsPps(_srs_clock);
SrsPps* _srs_pps_stwcc = new SrsPps(_srs_clock);
SrsPps* _srs_pps_srtcps = new SrsPps(_srs_clock);
SrsPps* _srs_pps_srtps = new SrsPps(_srs_clock);
@ -1300,7 +1299,7 @@ srs_error_t SrsRtcPublishStream::send_periodic_twcc()
return err;
}
++_srs_pps_stwcc->sugar;
++_srs_pps_srtcps->sugar;
char pkt[kRtcpPacketSize];
SrsBuffer *buffer = new SrsBuffer(pkt, sizeof(pkt));

@ -54,7 +54,6 @@ extern SrsPps* _srs_pps_fast_addrs;
extern SrsPps* _srs_pps_spkts;
extern SrsPps* _srs_pps_sstuns;
extern SrsPps* _srs_pps_stwcc;
extern SrsPps* _srs_pps_srtcps;
extern SrsPps* _srs_pps_srtps;
@ -73,6 +72,8 @@ extern SrsPps* _srs_pps_svnack;
extern SrsPps* _srs_pps_rnack;
extern SrsPps* _srs_pps_rnack2;
extern SrsPps* _srs_pps_rhnack;
extern SrsPps* _srs_pps_rmnack;
SrsRtcBlackhole::SrsRtcBlackhole()
{
@ -675,22 +676,22 @@ srs_error_t SrsRtcServer::notify(int type, srs_utime_t interval, srs_utime_t tic
}
// Update the pps stat for UDP socket and adddresses.
_srs_pps_rpkts->update(); _srs_pps_rrtps->update(); _srs_pps_rstuns->update(); _srs_pps_rrtcps->update(); _srs_pps_addrs->update(); _srs_pps_fast_addrs->update();
_srs_pps_spkts->update(); _srs_pps_srtps->update(); _srs_pps_sstuns->update(); _srs_pps_stwcc->update(); _srs_pps_srtcps->update();
_srs_pps_ids->update(); _srs_pps_fids->update(); _srs_pps_fids_level0->update();
_srs_pps_rpkts->update(); _srs_pps_rrtps->update(); _srs_pps_rstuns->update(); _srs_pps_rrtcps->update();
_srs_pps_spkts->update(); _srs_pps_srtps->update(); _srs_pps_sstuns->update(); _srs_pps_srtcps->update();
_srs_pps_pli->update(); _srs_pps_twcc->update(); _srs_pps_rr->update();
_srs_pps_snack->update(); _srs_pps_snack2->update(); _srs_pps_sanack->update(); _srs_pps_svnack->update();
_srs_pps_rnack->update(); _srs_pps_rnack2->update();
_srs_pps_rnack->update(); _srs_pps_rnack2->update(); _srs_pps_rhnack->update(); _srs_pps_rmnack->update();
_srs_pps_ids->update(); _srs_pps_fids->update(); _srs_pps_fids_level0->update(); _srs_pps_addrs->update(); _srs_pps_fast_addrs->update();
// TODO: FIXME: Show more data for RTC server.
srs_trace("RTC: Server conns=%u, rpkts=%d,%d,%d,%d,%d,%d, spkts=%d,%d,%d,%d,%d, fid=%d,%d,%d, rtcp=%d,%d,%d, snk=%d,%d,%d,%d, rnk=%d,%d",
srs_trace("RTC: Server conns=%u, rpkts=%d,%d,%d,%d, spkts=%d,%d,%d,%d, rtcp=%d,%d,%d, snk=%d,%d,%d,%d, rnk=%d,%d,%d,%d, fid=%d,%d,%d,%d,%d",
nn_rtc_conns,
_srs_pps_rpkts->r10s(), _srs_pps_rrtps->r10s(), _srs_pps_rstuns->r10s(), _srs_pps_rrtcps->r10s(), _srs_pps_addrs->r10s(), _srs_pps_fast_addrs->r10s(),
_srs_pps_spkts->r10s(), _srs_pps_srtps->r10s(), _srs_pps_sstuns->r10s(), _srs_pps_stwcc->r10s(), _srs_pps_srtcps->r10s(),
_srs_pps_ids->r10s(), _srs_pps_fids->r10s(), _srs_pps_fids_level0->r10s(),
_srs_pps_rpkts->r10s(), _srs_pps_rrtps->r10s(), _srs_pps_rstuns->r10s(), _srs_pps_rrtcps->r10s(),
_srs_pps_spkts->r10s(), _srs_pps_srtps->r10s(), _srs_pps_sstuns->r10s(), _srs_pps_srtcps->r10s(),
_srs_pps_pli->r10s(), _srs_pps_twcc->r10s(), _srs_pps_rr->r10s(),
_srs_pps_snack->r10s(), _srs_pps_snack2->r10s(), _srs_pps_sanack->r10s(), _srs_pps_svnack->r10s(),
_srs_pps_rnack->r10s(), _srs_pps_rnack2->r10s()
_srs_pps_snack->r10s(), _srs_pps_sanack->r10s(), _srs_pps_svnack->r10s(), _srs_pps_snack2->r10s(),
_srs_pps_rnack->r10s(), _srs_pps_rnack2->r10s(), _srs_pps_rhnack->r10s(), _srs_pps_rmnack->r10s(),
_srs_pps_ids->r10s(), _srs_pps_fids->r10s(), _srs_pps_fids_level0->r10s(), _srs_pps_addrs->r10s(), _srs_pps_fast_addrs->r10s()
);
return err;

@ -58,6 +58,8 @@ SrsPps* _srs_pps_svnack = new SrsPps(_srs_clock);
SrsPps* _srs_pps_rnack = new SrsPps(_srs_clock);
SrsPps* _srs_pps_rnack2 = new SrsPps(_srs_clock);
SrsPps* _srs_pps_rhnack = new SrsPps(_srs_clock);
SrsPps* _srs_pps_rmnack = new SrsPps(_srs_clock);
// Firefox defaults as 109, Chrome is 111.
const int kAudioPayloadType = 111;
@ -2002,8 +2004,10 @@ SrsRtpPacket2* SrsRtcSendTrack::fetch_rtp_packet(uint16_t seq)
// For NACK, it sequence must match exactly, or it cause SRTP fail.
// Return packet only when sequence is equal.
if (pkt->header.get_sequence() == seq) {
++_srs_pps_rhnack->sugar;
return pkt;
}
++_srs_pps_rmnack->sugar;
// Ignore if sequence not match.
uint32_t nn = 0;

Loading…
Cancel
Save