monitor.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * @Description:
  3. * @Version: 1.0
  4. * @Autor: lishengyin
  5. * @Date: 2022-01-10 15:01:15
  6. * @LastEditors: lishengyin
  7. * @LastEditTime: 2022-10-09 09:15:08
  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 "Util/SqlPool.h"
  23. #include "Network/TcpClient.h"
  24. #include "Poller/Timer.h"
  25. #include "Shell.h"
  26. using namespace toolkit;
  27. using namespace std;
  28. namespace MIVA
  29. {
  30. class monitor
  31. {
  32. private:
  33. FILE *file = nullptr;
  34. public:
  35. monitor();
  36. ~monitor();
  37. /**
  38. * @description: 创建实例
  39. * @param {*}
  40. * @return {*}
  41. */
  42. static std::shared_ptr<monitor> CreateNew();
  43. /**
  44. * @description: 释放资源
  45. * @param {*}
  46. * @return {*}
  47. */
  48. void Destory();
  49. /**
  50. * @description: 获取内存使用情况
  51. * @param {*}
  52. * @return {*}
  53. */
  54. int32_t getMemoryUsage();
  55. /**
  56. * @description: 获取Cpu使用情况
  57. * TODO
  58. * @param {*}
  59. * @return {*}
  60. */
  61. int32_t getCpuUsage();
  62. /**
  63. * @description: 获取Cpu温度
  64. * TODO
  65. * @param {*}
  66. * @return {*}
  67. */
  68. int32_t getCpuTemp();
  69. /**
  70. * @description: 获取GPU温度
  71. * @param {*}
  72. * @return {*}
  73. */
  74. int32_t getGpuTemp();
  75. /**
  76. * @description: 获取AUX温度
  77. * @param {*}
  78. * @return {*}
  79. */
  80. int32_t getAUXTemp();
  81. /**
  82. * @description: 获取AO温度
  83. * @param {*}
  84. * @return {*}
  85. */
  86. int32_t getA0Temp();
  87. /**
  88. * @description: 获取Thermal
  89. * @param {*}
  90. * @return {*}
  91. */
  92. int32_t getThermalTemp();
  93. /**
  94. * @description: 获取Gpu使用情况
  95. * TODO
  96. * @param {*}
  97. * @return {*}
  98. */
  99. int32_t getGpuUsage();
  100. /**
  101. * @description: 获取文件句柄使用情况
  102. * @param {*}
  103. * @return {*}
  104. */
  105. int32_t getFdUsage();
  106. };
  107. } // namespace MIVA