File: procmeter.h

package info (click to toggle)
procmeter 2.5.1-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 260 kB
  • ctags: 197
  • sloc: ansic: 2,006; sh: 206; perl: 140; makefile: 106
file content (105 lines) | stat: -rw-r--r-- 2,902 bytes parent folder | download | duplicates (3)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/***************************************
  $Header: /home/amb/procmeter/RCS/procmeter.h 2.17 1999/02/24 19:51:29 amb Exp $

  ProcMeter - A performance metering/logging program for Linux - Version 2.5.1.
  ******************/ /******************
  Written by Andrew M. Bishop

  This file Copyright 1994,95,96,97,98,99 Andrew M. Bishop
  It may be distributed under the GNU Public License, version 2, or
  any higher version.  See section COPYING of the GNU Public license
  for conditions under which this file may be redistributed.
  ***************************************/


#ifndef PROCMETER_H
#define PROCMETER_H    /*+ To stop multiple inclusions. +*/

#include <sys/types.h>

typedef enum { CPU,
               CPU_USER,
               CPU_NICE,
               CPU_SYS,
               CPU_IDLE,
               LOAD,
               PROC,
               FORK,
               CONTEXT,
               SWAP,
               SWAP_IN,
               SWAP_OUT,
               PAGE,
               PAGE_IN,
               PAGE_OUT,
               DISK,
               DISK_RD,
               DISK_WR,
               INTR,
               MEM_FREE,
               MEM_USED,
               MEM_BUFF,
               MEM_CACHE,
               MEM_AVAIL,
               MEM_SWAP,
               LPKT,
               LBYTE,
               FPKT,
               FBYTE,
               FPKT_RX,
               FBYTE_RX,
               FPKT_TX,
               FBYTE_TX,
               FPKT_COLL,
               SPKT,
               SBYTE,
               SPKT_RX,
               SBYTE_RX,
               SPKT_TX,
               SBYTE_TX,
               BATT_LIFE,
               BATT_LVL,
               NProcStats
              } ProcStatistics;

typedef struct _Statistics
{
 char   name[16];               /*+ The name of the statistic. +*/
 char   *file;                  /*+ The name of the file to get the statistics from. +*/
 char   units[8];               /*+ The name of the units. +*/
 char   avail;                  /*+ A true value if the statistic is available. +*/
 long   scale;                  /*+ The scaling factor to apply. +*/
 char   used;                   /*+ True if this statistic is being used. +*/
 double value;                  /*+ The current value of this statistic. +*/
}
Statistics;

extern Statistics ProcStats[NProcStats];
extern Statistics *OtherStats;

extern long NOtherStats;

/* In statistics.c */

void VerifyProcStatistics(void);
void VerifyOtherStatistics(char *filename);
void GetStatistics(void);
double CurrentValue(int type);

/* In xwindow.c */

void StartX(int *argc,char **argv);
void StopX(void);
void UpdateMetersX(void);
void AddRemoveMeterX(int type);
void SleepX(time_t until);

/* In log.c */

void StartLog(void);
void StopLog(void);
void UpdateMetersLog(time_t now);
void AddRemoveMeterLog(int type);
void SleepNotX(time_t until);

#endif /* PROCMETER_H */