-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcpustatreader.h
More file actions
49 lines (33 loc) · 1.32 KB
/
cpustatreader.h
File metadata and controls
49 lines (33 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef CPUSTATREADER_H
#define CPUSTATREADER_H
#include <deque>
#include <string>
#include <cpustats.h>
#include "StatReader.h"
#include <QObject>
#include <QString>
namespace StatTypes{
struct CPUData{
// inline CPUData(int dataPointsPerMinute) : currentActivityData(dataPointsPerMinute,0.0),currentClockSpeed(dataPointsPerMinute,0.0){}
std::string CPUName = "CPU"; //!< name of the CPU, exmp CPUAll, CPU0,..
std::deque<double> currentActivityData; //!< vector that always holds one minute of datapoints of cpu activity data, constant ammoutn of element
std::deque<double> currentClockSpeed; //!< vector that always holds one minute of datapoints of transfer statitisc data, constant ammoutn of elemen
};
}
class CPUStatReader : public QObject, public StatReader<StatTypes::CPUData>
{
Q_OBJECT
public:
CPUStatReader();
void measure_main_loop(); //!< implements the main measurement loop that runs contionously untils stopped in a separate thread
friend class LTM;
QString CPUCoresPhys = "0";
QString CPUCoresLogical = "0";
QString cacheSize = "0";
QString model = " ";
signals:
void data_ready();
};
//Q_DECLARE_METATYPE(QVector<StatTypes::CPUData>);
//Q_DECLARE_METATYPE(std::mutex);
#endif // CPUSTATREADER_H