superkaramba
cpu.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef CPUSENSOR_H
00011 #define CPUSENSOR_H
00012
00013 #include "sensor.h"
00014
00015 class CPUSensor : public Sensor
00016 {
00017 Q_OBJECT
00018 public:
00019 CPUSensor(const QString &cpu, int interval);
00020 ~CPUSensor();
00021
00022 void update();
00023 void setMaxValue(SensorParams *sp);
00024
00025 int getCPULoad();
00026
00027 private:
00028 long userTicks;
00029 long sysTicks;
00030 long niceTicks;
00031 long idleTicks;
00032
00033 int user;
00034 int system;
00035 int nice;
00036 int idle;
00037 int suload;
00038
00039 void getTicks(long &u, long &s, long &n, long &i);
00040 QString cpuNbr;
00041
00042 };
00043
00044 #endif // CPUSENSOR_H