-
Notifications
You must be signed in to change notification settings - Fork 4
/
ngx_http_reqstat.h
99 lines (72 loc) · 3.33 KB
/
ngx_http_reqstat.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
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
#include <nginx.h>
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
typedef struct ngx_http_reqstat_rbnode_s ngx_http_reqstat_rbnode_t;
typedef ngx_int_t (*ngx_http_input_body_filter_pt)
(ngx_http_request_t *r, ngx_buf_t *buf);
extern ngx_http_input_body_filter_pt ngx_http_top_input_body_filter;
struct ngx_http_reqstat_rbnode_s {
u_char color;
u_char padding[3];
uint32_t len;
ngx_queue_t queue;
ngx_atomic_t bytes_in;
ngx_atomic_t bytes_out;
ngx_atomic_t conn_total;
ngx_atomic_t req_total;
ngx_atomic_t http_2xx;
ngx_atomic_t http_3xx;
ngx_atomic_t http_4xx;
ngx_atomic_t http_5xx;
ngx_atomic_t other_status;
ngx_atomic_t rt;
ngx_atomic_t ureq;
ngx_atomic_t urt;
ngx_atomic_t utries;
u_char data[1];
};
typedef struct {
ngx_array_t *monitor;
ngx_array_t *display;
ngx_array_t *bypass;
} ngx_http_reqstat_conf_t;
typedef struct {
ngx_rbtree_t rbtree;
ngx_rbtree_node_t sentinel;
ngx_queue_t queue;
} ngx_http_reqstat_shctx_t;
typedef struct {
ngx_str_t *val;
ngx_slab_pool_t *shpool;
ngx_http_reqstat_shctx_t *sh;
ngx_http_complex_value_t value;
} ngx_http_reqstat_ctx_t;
#define NGX_HTTP_REQSTAT_BYTES_IN \
offsetof(ngx_http_reqstat_rbnode_t, bytes_in)
#define NGX_HTTP_REQSTAT_BYTES_OUT \
offsetof(ngx_http_reqstat_rbnode_t, bytes_out)
#define NGX_HTTP_REQSTAT_CONN_TOTAL \
offsetof(ngx_http_reqstat_rbnode_t, conn_total)
#define NGX_HTTP_REQSTAT_REQ_TOTAL \
offsetof(ngx_http_reqstat_rbnode_t, req_total)
#define NGX_HTTP_REQSTAT_2XX \
offsetof(ngx_http_reqstat_rbnode_t, http_2xx)
#define NGX_HTTP_REQSTAT_3XX \
offsetof(ngx_http_reqstat_rbnode_t, http_3xx)
#define NGX_HTTP_REQSTAT_4XX \
offsetof(ngx_http_reqstat_rbnode_t, http_4xx)
#define NGX_HTTP_REQSTAT_5XX \
offsetof(ngx_http_reqstat_rbnode_t, http_5xx)
#define NGX_HTTP_REQSTAT_OTHER_STATUS \
offsetof(ngx_http_reqstat_rbnode_t, other_status)
#define NGX_HTTP_REQSTAT_RT \
offsetof(ngx_http_reqstat_rbnode_t, rt)
#define NGX_HTTP_REQSTAT_UPS_REQ \
offsetof(ngx_http_reqstat_rbnode_t, ureq)
#define NGX_HTTP_REQSTAT_UPS_RT \
offsetof(ngx_http_reqstat_rbnode_t, urt)
#define NGX_HTTP_REQSTAT_UPS_TRIES \
offsetof(ngx_http_reqstat_rbnode_t, utries)
#define REQ_FIELD(node, offset) \
((ngx_atomic_t *) ((char *) node + offset))