/* * @Description: * @Version: 1.0 * @Autor: lishengyin * @Date: 2022-01-11 10:44:52 * @LastEditors: lishengyin * @LastEditTime: 2022-07-08 09:18:27 */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include "Util/logger.h" #include "Util/NoticeCenter.h" #include "Poller/EventPoller.h" #include "Util/SqlPool.h" #include "Network/TcpClient.h" #include "Poller/Timer.h" #include "monitor.h" #include using namespace toolkit; using namespace std; namespace gsd_ds { class deviceState { public: using Ptr = std::shared_ptr; int CpuUsage; int GpuUsage; int MemoryUsage; int CpuTemp; int GpuTemp = 0; int AUXTemp = 0; int A0Temp = 0; int ThermalTemp = 0; int FdUsage; public: deviceState(); ~deviceState(); /** * @description: 创建实例 * @param {*} * @return {*} */ static std::shared_ptr CreateNew(); /** * @description: 获取设备数据 * @param {*} * @return {*} */ int32_t getDeviceState(); /** * @description: 同步设备数据 * @param {*} * @return {*} */ int32_t SyncDeviceState(std::string& Ctime); /** * @description:同步fd阈值 * @param {*} * @return {*} */ int32_t SyncFdThreshold(int sourceNum, bool outState); private: mutex m_mutex; }; } // namespace gsd_ds