diff --git a/server/gameserver/app.cc b/server/gameserver/app.cc index 1c70723d..ce57d5b1 100644 --- a/server/gameserver/app.cc +++ b/server/gameserver/app.cc @@ -27,6 +27,7 @@ #include "killmgr.h" #include "httpproxy.h" #include "lispenv.h" +#include "perf.h" #include "ss_msgid.pb.h" #include "ss_proto.pb.h" @@ -160,6 +161,7 @@ bool App::Init(int argc, char* argv[]) #ifdef DEBUG TraceMgr::Instance()->Init("gameserver2006"); #endif + Perf::Instance()->Init(); PerfMonitor::Instance()->Init(); f8::MsgQueue::Instance()->Init(); HandlerMgr::Instance()->Init(); @@ -240,6 +242,7 @@ void App::UnInit() f8::MsgQueue::Instance()->UnInit(); f8::Timer::Instance()->UnInit(); PerfMonitor::Instance()->UnInit(); + Perf::Instance()->UnInit(); f8::TGLog::Instance()->UnInit(); #ifdef DEBUG TraceMgr::Instance()->UnInit(); diff --git a/server/gameserver/perf.cc b/server/gameserver/perf.cc new file mode 100644 index 00000000..96a2686f --- /dev/null +++ b/server/gameserver/perf.cc @@ -0,0 +1,18 @@ +#include "precompile.h" + +#include "perf.h" + +void Perf::Init() +{ + +} + +void Perf::UnInit() +{ + +} + +void Perf::Output() +{ + +} diff --git a/server/gameserver/perf.h b/server/gameserver/perf.h new file mode 100644 index 00000000..33ae12cf --- /dev/null +++ b/server/gameserver/perf.h @@ -0,0 +1,25 @@ +#pragma once + +#define PERF 1 + +#include + +class Perf : public a8::Singleton +{ +private: + Perf() {}; + friend class a8::Singleton; + public: + void Init(); + void UnInit(); + + long long entity_num = 0; + long long buff_num = 0; + long long bt_co_num = 0; + long long agent_num = 0; + long long frame_call_num = 0; + + private: + void Output(); + +};