monitor.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * @Description:
  3. * @Version: 1.0
  4. * @Autor: lishengyin
  5. * @Date: 2022-01-10 15:01:15
  6. * @LastEditors: lishengyin
  7. * @LastEditTime: 2022-01-12 09:30:02
  8. */
  9. #pragma once
  10. #include <iostream>
  11. #include <map>
  12. #include <time.h>
  13. #include <dirent.h>
  14. #include <time.h>
  15. #include <cstdlib>
  16. #include <dirent.h>
  17. #include <sys/types.h>
  18. #include <sys/stat.h>
  19. #include <unistd.h>
  20. #include "Util/logger.h"
  21. #include "Util/NoticeCenter.h"
  22. #include "Poller/EventPoller.h"
  23. #include "Player/PlayerProxy.h"
  24. #include "Rtmp/RtmpPusher.h"
  25. #include "Common/config.h"
  26. #include "Pusher/MediaPusher.h"
  27. #include "Extension/Frame.h"
  28. #include "Util/SqlPool.h"
  29. #include "Network/TcpClient.h"
  30. #include "Poller/Timer.h"
  31. #include "Shell.h"
  32. using namespace toolkit;
  33. using namespace std;
  34. namespace MIVA
  35. {
  36. class monitor
  37. {
  38. private:
  39. FILE *file = nullptr;
  40. public:
  41. monitor();
  42. ~monitor();
  43. /**
  44. * @description: 创建实例
  45. * @param {*}
  46. * @return {*}
  47. */
  48. static std::shared_ptr<monitor> CreateNew();
  49. /**
  50. * @description: 释放资源
  51. * @param {*}
  52. * @return {*}
  53. */
  54. void Destory();
  55. /**
  56. * @description: 获取内存使用情况
  57. * @param {*}
  58. * @return {*}
  59. */
  60. int32_t getMemoryUsage();
  61. /**
  62. * @description: 获取Cpu使用情况
  63. * TODO
  64. * @param {*}
  65. * @return {*}
  66. */
  67. int32_t getCpuUsage();
  68. /**
  69. * @description: 获取Cpu温度
  70. * TODO
  71. * @param {*}
  72. * @return {*}
  73. */
  74. int32_t getCpuTemp();
  75. /**
  76. * @description: 获取GPU温度
  77. * @param {*}
  78. * @return {*}
  79. */
  80. int32_t getGpuTemp();
  81. /**
  82. * @description: 获取AUX温度
  83. * @param {*}
  84. * @return {*}
  85. */
  86. int32_t getAUXTemp();
  87. /**
  88. * @description: 获取AO温度
  89. * @param {*}
  90. * @return {*}
  91. */
  92. int32_t getA0Temp();
  93. /**
  94. * @description: 获取Thermal
  95. * @param {*}
  96. * @return {*}
  97. */
  98. int32_t getThermalTemp();
  99. /**
  100. * @description: 获取Gpu使用情况
  101. * TODO
  102. * @param {*}
  103. * @return {*}
  104. */
  105. int32_t getGpuUsage();
  106. /**
  107. * @description: 获取文件句柄使用情况
  108. * @param {*}
  109. * @return {*}
  110. */
  111. int32_t getFdUsage();
  112. };
  113. } // namespace MIVA