File: nfsmeter.h

package info (click to toggle)
xosview 1.24-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,184 kB
  • sloc: cpp: 11,975; makefile: 154; ansic: 32; awk: 13; sh: 8
file content (67 lines) | stat: -rw-r--r-- 1,191 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
//
//  This file may be distributed under terms of the GPL
//

#ifndef _NFSMETER_H_
#define _NFSMETER_H_

#include "fieldmetergraph.h"
#include "xosview.h"
#include "timer.h"


class NFSMeter : public FieldMeterGraph {
public:
	NFSMeter(
		XOSView *parent,
		const char *name,
		int   nfields,
		const char *files,
		const char *statfile);
  ~NFSMeter( void );

  const char *name( void ) const { return _statname; }
  void checkResources( void );
  void starttimer(void) { return _timer.start(); };
  void stoptimer(void) { return _timer.stop(); };
  double usecs(void) { return _timer.report_usecs(); };

protected:
  const char *_statname;
  const char *_statfile;

private:
  Timer _timer;

};

class NFSStats : public NFSMeter {
public:
  NFSStats(XOSView *parent);
  ~NFSStats(void);

  void checkevent( void );

  void checkResources( void );
private:
	unsigned long _lastcalls, _lastretrns, _lastauthrefresh;
};

class NFSDStats : public NFSMeter {
public:
  NFSDStats(XOSView *parent);
  ~NFSDStats(void);

  void checkevent( void );

  void checkResources( void );

protected:
  float maxpackets_;

private:
  unsigned long _lastTcp, _lastUdp, _lastNetCnt, _lastBad;
};

#endif