xosview  1.23
About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).
  Fossies Dox: xosview-1.23.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cpumeter.h
Go to the documentation of this file.
1 //
2 // Initial port performed by Greg Onufer (exodus@cheers.bungi.com)
3 //
4 #ifndef _CPUMETER_H_
5 #define _CPUMETER_H_
6 
7 #include "fieldmetergraph.h"
8 #include "xosview.h"
9 #include "kstats.h"
10 #include <kstat.h>
11 #include <sys/sysinfo.h>
12 
13 
14 class CPUMeter : public FieldMeterGraph {
15  public:
16  CPUMeter(XOSView *parent, kstat_ctl_t *kcp, int cpuid = 0);
17  ~CPUMeter(void);
18 
19  const char *name(void) const { return "CPUMeter"; }
20  void checkevent(void);
21  void checkResources(void);
22  static const char *cpuStr(int num);
23 
24  protected:
25  float cputime_[2][CPU_STATES];
26  int cpuindex_;
27 
28  void getcputime(void);
29 
30  private:
32  bool aggregate;
33  kstat_ctl_t *kc;
34  kstat_t *ksp;
35 };
36 
37 #endif
void checkevent(void)
static const char * cpuStr(int num)
CPUMeter(XOSView *parent, unsigned int nbr)
Definition: cpumeter.cc:23
kstat_ctl_t * kc
Definition: cpumeter.h:33
uint64_t cputime_[2][CPUSTATES]
Definition: cpumeter.h:44
void checkResources(void)
~CPUMeter(void)
const char * name(void) const
Definition: cpumeter.h:19
kstat_t * ksp
Definition: cpumeter.h:34
KStatList * cpustats
Definition: cpumeter.h:31
void getcputime(void)
bool aggregate
Definition: cpumeter.h:32
unsigned int cpuindex_
Definition: cpumeter.h:45