1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- /*
- * @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 <iostream>
- #include <iostream>
- #include <map>
- #include <time.h>
- #include <dirent.h>
- #include <time.h>
- #include <cstdlib>
- #include <dirent.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #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 <mutex>
- using namespace toolkit;
- using namespace std;
- namespace gsd_ds
- {
- class deviceState
- {
- public:
- using Ptr = std::shared_ptr<deviceState>;
- 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<deviceState> 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
|