From b7c7d6566f599a60da74a01a705f6139709acdee Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 10 Feb 2021 16:27:09 +0800 Subject: [PATCH] Fix build fail --- trunk/src/app/srs_app_hourglass.cpp | 9 ++++++++- trunk/src/app/srs_app_hybrid.cpp | 9 +++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/trunk/src/app/srs_app_hourglass.cpp b/trunk/src/app/srs_app_hourglass.cpp index 32b667861..f899a8b6b 100644 --- a/trunk/src/app/srs_app_hourglass.cpp +++ b/trunk/src/app/srs_app_hourglass.cpp @@ -28,6 +28,10 @@ using namespace std; #include #include +#include + +SrsPps* _srs_pps_timer = new SrsPps(_srs_clock); + ISrsHourGlass::ISrsHourGlass() { } @@ -36,8 +40,9 @@ ISrsHourGlass::~ISrsHourGlass() { } -SrsHourGlass::SrsHourGlass(ISrsHourGlass* h, srs_utime_t resolution) +SrsHourGlass::SrsHourGlass(string label, ISrsHourGlass* h, srs_utime_t resolution) { + label_ = label; handler = h; _resolution = resolution; total_elapse = 0; @@ -99,6 +104,8 @@ srs_error_t SrsHourGlass::cycle() srs_utime_t interval = it->second; if (interval == 0 || (total_elapse % interval) == 0) { + ++_srs_pps_timer->sugar; + if ((err = handler->notify(event, interval, total_elapse)) != srs_success) { return srs_error_wrap(err, "notify"); } diff --git a/trunk/src/app/srs_app_hybrid.cpp b/trunk/src/app/srs_app_hybrid.cpp index 528a5184f..8f7300215 100644 --- a/trunk/src/app/srs_app_hybrid.cpp +++ b/trunk/src/app/srs_app_hybrid.cpp @@ -225,14 +225,11 @@ srs_error_t SrsHybridServer::notify(int event, srs_utime_t interval, srs_utime_t // Resident Set Size: number of pages the process has in real memory. int memory = (int)(u->rss * 4 / 1024); - _srs_pps_cids_get->update(); _srs_pps_cids_set->update(); - _srs_pps_timer->update(); _srs_pps_pub->update(); _srs_pps_conn->update(); _srs_pps_dispose->update(); + _srs_pps_timer->update(); _srs_pps_pub->update(); _srs_pps_conn->update(); - srs_trace("Hybrid cpu=%.2f%%,%dMB, cid=%d,%d, timer=%d,%d,%d, free=%d", + srs_trace("Hybrid cpu=%.2f%%,%dMB, timer=%d,%d,%d", u->percent * 100, memory, - _srs_pps_cids_get->r10s(), _srs_pps_cids_set->r10s(), - _srs_pps_timer->r10s(), _srs_pps_pub->r10s(), _srs_pps_conn->r10s(), - _srs_pps_dispose->r10s() + _srs_pps_timer->r10s(), _srs_pps_pub->r10s(), _srs_pps_conn->r10s() ); return err;