diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 10e444cf..7d791214 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -1043,6 +1043,9 @@ void installWebApi() { val["data"]["BufferRaw"] = (Json::UInt64)(ObjectStatistic::count()); val["data"]["BufferLikeString"] = (Json::UInt64)(ObjectStatistic::count()); val["data"]["BufferList"] = (Json::UInt64)(ObjectStatistic::count()); + + val["data"]["RtpPacket"] = (Json::UInt64)(ObjectStatistic::count()); + val["data"]["RtmpPacket"] = (Json::UInt64)(ObjectStatistic::count()); }); ////////////以下是注册的Hook API//////////// diff --git a/src/Extension/Frame.h b/src/Extension/Frame.h index 4da57732..4988ac06 100644 --- a/src/Extension/Frame.h +++ b/src/Extension/Frame.h @@ -173,6 +173,8 @@ public: uint32_t _pts = 0; size_t _prefix_size = 0; BufferLikeString _buffer; + +private: //对象个数统计 ObjectStatistic _statistic; diff --git a/src/Rtmp/Rtmp.cpp b/src/Rtmp/Rtmp.cpp index 272e1c91..451f54e9 100644 --- a/src/Rtmp/Rtmp.cpp +++ b/src/Rtmp/Rtmp.cpp @@ -146,4 +146,8 @@ RtmpPacket::Ptr RtmpPacket::create(){ #endif } -}//namespace mediakit \ No newline at end of file +}//namespace mediakit + +namespace toolkit { + StatisticImp(mediakit::RtmpPacket); +} \ No newline at end of file diff --git a/src/Rtmp/Rtmp.h b/src/Rtmp/Rtmp.h index 15eec7f1..0e0a6cf4 100644 --- a/src/Rtmp/Rtmp.h +++ b/src/Rtmp/Rtmp.h @@ -213,6 +213,10 @@ private: RtmpPacket(){ clear(); } + +private: + //对象个数统计 + ObjectStatistic _statistic; }; /** diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index 70242a20..2d2c6d13 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -545,4 +545,8 @@ RtpPacket::Ptr RtpPacket::create(){ #endif } -}//namespace mediakit \ No newline at end of file +}//namespace mediakit + +namespace toolkit { + StatisticImp(mediakit::RtpPacket); +} \ No newline at end of file diff --git a/src/Rtsp/Rtsp.h b/src/Rtsp/Rtsp.h index 8b4f2508..4bf884d5 100644 --- a/src/Rtsp/Rtsp.h +++ b/src/Rtsp/Rtsp.h @@ -172,6 +172,10 @@ public: private: friend class ResourcePool_l; RtpPacket() = default; + +private: + //对象个数统计 + ObjectStatistic _statistic; }; class RtpPayload {