mirror of
https://github.com/oguzhaninan/Stacer.git
synced 2026-05-24 16:31:12 -04:00
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.
61 lines
1.3 KiB
C++
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
|