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 // Copyright (c) 1994, 1995 by Mike Romberg ( romberg@fsl.noaa.gov )
3 //
4 // NetBSD port:
5 // Copyright (c) 1995, 1996, 1997-2002 by Brian Grayson (bgrayson@netbsd.org)
6 //
7 // This file was written by Brian Grayson for the NetBSD and xosview
8 // projects.
9 // This file may be distributed under terms of the GPL or of the BSD
10 // license, whichever you choose. The full license notices are
11 // contained in the files COPYING.GPL and COPYING.BSD, which you
12 // should have received. If not, contact one of the xosview
13 // authors for a copy.
14 //
15 
16 #ifndef _CPUMETER_H_
17 #define _CPUMETER_H_
18 
19 #include "fieldmetergraph.h"
20 #include "xosview.h"
21 #include "defines.h"
22 
23 // for CPUSTATES
24 #if defined(XOSVIEW_NETBSD) || defined(XOSVIEW_OPENBSD)
25 #include <sys/sched.h>
26 #else
27 #include <sys/resource.h>
28 #endif
29 
30 
31 class CPUMeter : public FieldMeterGraph {
32 public:
33  CPUMeter( XOSView *parent, unsigned int nbr );
34  ~CPUMeter( void );
35 
36  const char *name( void ) const { return "CPUMeter"; }
37  void checkevent( void );
38  void checkResources( void );
39 
40 protected:
41  void getcputime( void );
42 
43 private:
44  uint64_t cputime_[2][CPUSTATES];
45  unsigned int cpuindex_, nbr_;
46 };
47 
48 
49 #endif
void checkevent(void)
Definition: cpumeter.cc:53
CPUMeter(XOSView *parent, unsigned int nbr)
Definition: cpumeter.cc:23
uint64_t cputime_[2][CPUSTATES]
Definition: cpumeter.h:44
void checkResources(void)
Definition: cpumeter.cc:39
~CPUMeter(void)
Definition: cpumeter.cc:36
const char * name(void) const
Definition: cpumeter.h:36
void getcputime(void)
Definition: cpumeter.cc:58
unsigned int nbr_
Definition: cpumeter.h:45
unsigned int cpuindex_
Definition: cpumeter.h:45