Files
Stacer/stacer/Managers/info_manager.h
Hill Ma 2a56f233ff Introduce CpuInfo::getCpuPhysicalCoreCount().
Hyper-threading, when enabled, makes the number of processors two
times the number of physical cores.

Member function getCpuPhysicalCoreCount() is introduced to get the
number of physical cores and it is used in "Dashboard" but not in
"Resources".

The way it works is that it counts the number of unique physical
id, core id pair in /proc/cpuinfo.
2020-07-05 16:49:32 -07:00

61 lines
1.3 KiB
C++

#ifndef INFO_MANAGER_H
#define INFO_MANAGER_H
#include <QObject>
#include <Info/cpu_info.h>
#include <Info/disk_info.h>
#include <Info/memory_info.h>
#include <Info/network_info.h>
#include <Info/system_info.h>
#include <Info/process_info.h>
class InfoManager
{
public:
static InfoManager *ins();
int getCpuCoreCount() const;
QList<int> getCpuPercents() const;
QList<double> getCpuLoadAvgs() const;
double getCpuClock() const;
quint64 getSwapUsed() const;
quint64 getSwapTotal() const;
quint64 getMemUsed() const;
quint64 getMemTotal() const;
void updateMemoryInfo();
quint64 getRXbytes() const;
quint64 getTXbytes() const;
QList<Disk *> getDisks() const;
QList<quint64> getDiskIO();
void updateDiskInfo();
QFileInfoList getCrashReports() const;
QFileInfoList getAppLogs() const;
QFileInfoList getAppCaches() const;
void updateProcesses();
QList<Process> getProcesses() const;
QString getUserName() const;
QStringList getUserList() const;
QStringList getGroupList() const;
QList<QString> getDevices();
QList<QString> getFileSystemTypes();
private:
static InfoManager *instance;
private:
CpuInfo ci;
DiskInfo di;
MemoryInfo mi;
NetworkInfo ni;
SystemInfo si;
ProcessInfo pi;
};
#endif // INFO_MANAGER_H