#ifndef EXT_TOOLS_SYSTEM_INFO_H
#define EXT_TOOLS_SYSTEM_INFO_H
#include "random.hpp"
#include "cpu_core_info.hpp"
#include <string>
#include <vector>
#include <memory>
#include <map>
namespace doWhile::doct
{
class SystemInfoTaskRunner;
}
namespace doWhile::doct::ext_tools
{
class SystemInfo
{
public:
static SystemInfo* get(std::string hostname);
/**
* \brief Information about CPU cores and utilization
*/
std::vector<std::shared_ptr<CpuCoreInfo>> getCpus();
/**
* \brief Memory used in megabytes
*/
void setMemoryUsage(int value);
/**
* \brief Memory used in megabytes
*/
int getMemoryUsage();
/**
* \brief Total installed memory in megabytes
*/
int getTotalMemory();
/**
* \brief Total available bandwidth in megabits per seconds
*/
int getTotalBandwidth();
private:
inline static std::map<std::string, std::unique_ptr<SystemInfo>> instances;
SystemInfo(std::string hostname);
std::string hostname;
int targetMemoryUsage;
friend doWhile::doct::SystemInfoTaskRunner;
};
}
#endif // EXT_TOOLS_SYSTEM_INFO_H