-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwomper.h
49 lines (40 loc) · 979 Bytes
/
womper.h
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
#ifndef WOMPER_H
#define WOMPER_H
#include <signal.h>
#include <QStringList>
#include <QVector>
#include <QHash>
class QProcess;
class Womper
{
public:
Womper(QString watchUser);
void scan();
void allowOne();
void allowTwo();
void allowAll();
bool suspendToOne();
struct ProcessInfo
{
pid_t pid;
char status;
QString cmd;
long rss;
// QString cwd;
};
int running;
int swamped;
int stopped;
QVector<ProcessInfo> processes;
QVector<ProcessInfo> oldProcesses;
QVector<pid_t> pids;
QHash<pid_t, long> highWaterMark; // largest size (in KB) of memory usage we've seen for each process
long lastBigSize; // size in KB of the last exited biggest running process
long biggestRunning; // size in KB of the currently biggest running process
private:
QProcess* process;
QStringList args;
QStringList watches;
QStringList compilers;
};
#endif // WOMPER_H