-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathnet_stats.h
49 lines (39 loc) · 923 Bytes
/
net_stats.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 _NET_STATS_H_
#define _NET_STATS_H_
#include <net/if.h>
#include "postgres.h"
typedef struct net_stat {
char name[IF_NAMESIZE + 1];
unsigned long long rx_bytes;
unsigned long long rx_packets;
unsigned long long rx_errors;
unsigned long long tx_bytes;
unsigned long long tx_packets;
unsigned long long tx_errors;
unsigned long long collisions;
unsigned long long saturation;
long long speed;
char duplex;
double rx_bytes_diff;
double rx_packets_diff;
double rx_errors_diff;
double rx_util;
double tx_bytes_diff;
double tx_packets_diff;
double tx_errors_diff;
double tx_util;
double util;
double collisions_diff;
double saturation_diff;
bool is_used;
bool has_statistics;
} net_stat;
typedef struct net_stats {
unsigned long long uptime;
net_stat *values;
size_t size;
size_t len;
} net_stats;
void net_stats_init(void);
net_stats get_net_stats(void);
#endif /* _NET_STATS_H_ */