File: loadmeter.h

package info (click to toggle)
xosview 1.25-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,136 kB
  • sloc: cpp: 11,982; makefile: 154; ansic: 32; awk: 13; sh: 8
file content (39 lines) | stat: -rw-r--r-- 788 bytes parent folder | download | duplicates (5)
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
//  
//  Initial port performed by Greg Onufer (exodus@cheers.bungi.com)
//
#ifndef _LOADMETER_H_
#define _LOADMETER_H_

#include "fieldmetergraph.h"
#include "xosview.h"
#include "kstats.h"
#include <kstat.h>


class LoadMeter : public FieldMeterGraph {
 public:
	LoadMeter(XOSView *parent, kstat_ctl_t *kcp);
	~LoadMeter(void);

	const char *name(void) const { return "LoadMeter"; }
	void checkevent(void);
	void checkResources(void);

 protected:
	void getloadinfo(void);
	void getspeedinfo(void);

 private:
	unsigned long procloadcol, warnloadcol, critloadcol;
	unsigned int warnThreshold, critThreshold;
	unsigned int old_cpu_speed, cur_cpu_speed;
	int lastalarmstate;
	bool do_cpu_speed;
	KStatList *cpulist;
	kstat_ctl_t *kc;
#ifdef NO_GETLOADAVG
	kstat_t *ksp;
#endif
};

#endif