StatImp.h 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. 
  2. #ifndef __STAT_IMP_H_
  3. #define __STAT_IMP_H_
  4. #include <functional>
  5. #include "util/tc_common.h"
  6. #include "util/tc_thread.h"
  7. #include "servant/RemoteLogger.h"
  8. #include "servant/StatF.h"
  9. using namespace tars;
  10. class StatImp : public StatF
  11. {
  12. public:
  13. /**
  14. *
  15. */
  16. StatImp()
  17. {
  18. }
  19. ~StatImp()
  20. {
  21. }
  22. /**
  23. * 初始化
  24. *
  25. * @return int
  26. */
  27. virtual void initialize() {};
  28. /**
  29. * 退出
  30. */
  31. virtual void destroy()
  32. {
  33. }
  34. /**
  35. * 上报模块间调用信息
  36. * @param statmsg, 上报信息
  37. * @return int, 返回0表示成功
  38. */
  39. virtual int reportMicMsg( const map<tars::StatMicMsgHead, tars::StatMicMsgBody>& statmsg, bool bFromClient, tars::CurrentPtr current );
  40. /**
  41. * 上报模块间调用采样信息
  42. * @param sample, 上报信息
  43. * @return int, 返回0表示成功
  44. */
  45. virtual int reportSampleMsg(const vector<StatSampleMsg> &msg,tars::CurrentPtr current );
  46. };
  47. #endif