From 5b8eea8cc52d56381d27f8e8675b06f872e499d9 Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 19 Feb 2021 19:08:16 +0800 Subject: [PATCH] Stat: Fix build fail for stat of timer and dispose --- trunk/src/app/srs_app_conn.cpp | 3 +++ trunk/src/protocol/srs_service_log.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/trunk/src/app/srs_app_conn.cpp b/trunk/src/app/srs_app_conn.cpp index fffa224f2..17301c4c4 100644 --- a/trunk/src/app/srs_app_conn.cpp +++ b/trunk/src/app/srs_app_conn.cpp @@ -41,6 +41,7 @@ using namespace std; SrsPps* _srs_pps_ids = new SrsPps(_srs_clock); SrsPps* _srs_pps_fids = new SrsPps(_srs_clock); SrsPps* _srs_pps_fids_level0 = new SrsPps(_srs_clock); +SrsPps* _srs_pps_dispose = new SrsPps(_srs_clock); ISrsDisposingHandler::ISrsDisposingHandler() { @@ -343,6 +344,8 @@ void SrsResourceManager::do_clear() i, conn->desc().c_str(), conn, (int)conns_.size(), (int)copy.size(), (int)zombies_.size()); } + ++_srs_pps_dispose->sugar; + dispose(conn); } diff --git a/trunk/src/protocol/srs_service_log.cpp b/trunk/src/protocol/srs_service_log.cpp index 5dafb4c05..fbd1e4b9e 100644 --- a/trunk/src/protocol/srs_service_log.cpp +++ b/trunk/src/protocol/srs_service_log.cpp @@ -33,6 +33,11 @@ using namespace std; #include #include +#include + +SrsPps* _srs_pps_cids_get = new SrsPps(_srs_clock); +SrsPps* _srs_pps_cids_set = new SrsPps(_srs_clock); + #define SRS_BASIC_LOG_SIZE 8192 SrsThreadContext::SrsThreadContext() @@ -51,11 +56,15 @@ SrsContextId SrsThreadContext::generate_id() const SrsContextId& SrsThreadContext::get_id() { + ++_srs_pps_cids_get->sugar; + return cache[srs_thread_self()]; } const SrsContextId& SrsThreadContext::set_id(const SrsContextId& v) { + ++_srs_pps_cids_set->sugar; + srs_thread_t self = srs_thread_self(); if (cache.find(self) == cache.end()) {