1 |
#ifdef WIN32 |
2 |
#include <pdh.h> |
3 |
|
4 |
typedef enum { |
5 |
SG_WIN32_PROC_USER, |
6 |
SG_WIN32_PROC_PRIV, |
7 |
SG_WIN32_PROC_IDLE, |
8 |
SG_WIN32_PROC_INT, |
9 |
SG_WIN32_MEM_CACHE, |
10 |
SG_WIN32_UPTIME, |
11 |
SG_WIN32_PAGEIN, |
12 |
SG_WIN32_PAGEOUT, |
13 |
SG_WIN32_SIZE /* Leave this as last entry */ |
14 |
} pdh_enum; |
15 |
|
16 |
#define PDH_USER "\\Processor(_Total)\\% User Time" |
17 |
#define PDH_PRIV "\\Processor(_Total)\\% Privileged Time" |
18 |
#define PDH_IDLE "\\Processor(_Total)\\% Processor Time" |
19 |
#define PDH_INTER "\\Processor(_Total)\\% Interrupt Time" |
20 |
#define PDH_DISKIOREAD "\\PhysicalDisk(%s)\\Disk Read Bytes/sec" |
21 |
#define PDH_DISKIOWRITE "\\PhysicalDisk(%s)\\Disk Write Bytes/sec" |
22 |
#define PDH_MEM_CACHE "\\Memory\\Cache Bytes" |
23 |
#define PDH_UPTIME "\\System\\System Up Time" |
24 |
#define PDH_PAGEIN "\\Memory\\Pages Input/sec" |
25 |
#define PDH_PAGEOUT "\\Memory\\Pages Output/sec" |
26 |
|
27 |
int add_counter(const char *fullCounterPath, HCOUNTER *phCounter); |
28 |
int read_counter_double(pdh_enum counter, double *result); |
29 |
int read_counter_large(pdh_enum counter, long long *result); |
30 |
char *get_diskio(const int no, long long *read, long long *write); |
31 |
int get_netio(const int no, char **name, long long *read, long long *write); |
32 |
|
33 |
int sg_win32_snapshot(); |
34 |
int sg_win32_start_capture(); |
35 |
void sg_win32_end_capture(); |
36 |
|
37 |
#endif |