You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
572 B
C
24 lines
572 B
C
#include "sys/types.h"
|
|
#include "sys/sysinfo.h"
|
|
#include "stdlib.h"
|
|
#include "stdio.h"
|
|
#include "string.h"
|
|
#include "sys/times.h"
|
|
#include "sys/vtimes.h"
|
|
|
|
void getTotalVirtualMem();
|
|
void getVirtualMemUsed();
|
|
int getVirtualMemUsedByCurrentProcess();
|
|
|
|
struct cpustat {
|
|
unsigned long t_user;
|
|
unsigned long t_nice;
|
|
unsigned long t_system;
|
|
unsigned long t_idle;
|
|
unsigned long t_iowait;
|
|
unsigned long t_irq;
|
|
unsigned long t_softirq;
|
|
};
|
|
|
|
void get_stats(struct cpustat *st, int cpunum);
|
|
double calculate_load(struct cpustat *prev, struct cpustat *cur); |