1 /*
2  * include/types/counters.h
3  * This file contains structure declarations for statistics counters.
4  *
5  * Copyright 2008-2009 Krzysztof Piotr Oledzki <ole@ans.pl>
6  * Copyright 2011-2014 Willy Tarreau <w@1wt.eu>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation, version 2.1
11  * exclusively.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22 
23 #ifndef _TYPES_COUNTERS_H
24 #define _TYPES_COUNTERS_H
25 
26 /* counters used by listeners and frontends */
27 struct fe_counters {
28 	unsigned int conn_max;                  /* max # of active sessions */
29 	long long    cum_conn;                  /* cumulated number of received connections */
30 	long long    cum_sess;                  /* cumulated number of accepted connections */
31 
32 	unsigned int cps_max;                   /* maximum of new connections received per second */
33 	unsigned int sps_max;                   /* maximum of new connections accepted per second (sessions) */
34 
35 	long long bytes_in;                     /* number of bytes transferred from the client to the server */
36 	long long bytes_out;                    /* number of bytes transferred from the server to the client */
37 
38 	long long comp_in;                      /* input bytes fed to the compressor */
39 	long long comp_out;                     /* output bytes emitted by the compressor */
40 	long long comp_byp;                     /* input bytes that bypassed the compressor (cpu/ram/bw limitation) */
41 
42 	long long denied_req;                   /* blocked requests because of security concerns */
43 	long long denied_resp;                  /* blocked responses because of security concerns */
44 	long long failed_req;                   /* failed requests (eg: invalid or timeout) */
45 	long long denied_conn;                  /* denied connection requests (tcp-req-conn rules) */
46 	long long denied_sess;                  /* denied session requests (tcp-req-sess rules) */
47 	long long failed_rewrites;              /* failed rewrites (warning) */
48 
49 	long long cli_aborts;                   /* aborted responses during DATA phase caused by the client */
50 	long long srv_aborts;                   /* aborted responses during DATA phase caused by the server */
51 	long long intercepted_req;              /* number of monitoring or stats requests intercepted by the frontend */
52 
53 	union {
54 		struct {
55 			long long cum_req;      /* cumulated number of processed HTTP requests */
56 			long long comp_rsp;     /* number of compressed responses */
57 			unsigned int rps_max;   /* maximum of new HTTP requests second observed */
58 			long long rsp[6];       /* http response codes */
59 			long long cache_lookups;/* cache lookups */
60 			long long cache_hits;   /* cache hits */
61 		} http;
62 	} p;                                    /* protocol-specific stats */
63 };
64 
65 /* counters used by servers and backends */
66 struct be_counters {
67 	unsigned int conn_max;                  /* max # of active sessions */
68 	long long    cum_conn;                  /* cumulated number of received connections */
69 	long long    cum_sess;                  /* cumulated number of accepted connections */
70 	long long  cum_lbconn;                  /* cumulated number of sessions processed by load balancing (BE only) */
71 	unsigned long last_sess;                /* last session time */
72 
73 	unsigned int cps_max;                   /* maximum of new connections received per second */
74 	unsigned int sps_max;                   /* maximum of new connections accepted per second (sessions) */
75 	unsigned int nbpend_max;                /* max number of pending connections with no server assigned yet (BE only) */
76 	unsigned int cur_sess_max;		/* max number of currently active sessions */
77 
78 	long long bytes_in;                     /* number of bytes transferred from the client to the server */
79 	long long bytes_out;                    /* number of bytes transferred from the server to the client */
80 
81 	long long comp_in;                      /* input bytes fed to the compressor */
82 	long long comp_out;                     /* output bytes emitted by the compressor */
83 	long long comp_byp;                     /* input bytes that bypassed the compressor (cpu/ram/bw limitation) */
84 
85 	long long denied_req;                   /* blocked requests because of security concerns */
86 	long long denied_resp;                  /* blocked responses because of security concerns */
87 
88 	long long connect;                      /* number of connection establishment attempts */
89 	long long reuse;                        /* number of connection reuses */
90 	long long failed_conns;                 /* failed connect() attempts (BE only) */
91 	long long failed_resp;                  /* failed responses (BE only) */
92 	long long cli_aborts;                   /* aborted responses during DATA phase caused by the client */
93 	long long srv_aborts;                   /* aborted responses during DATA phase caused by the server */
94 	long long retries;                      /* retried and redispatched connections (BE only) */
95 	long long redispatches;                 /* retried and redispatched connections (BE only) */
96 	long long failed_rewrites;              /* failed rewrites (warning) */
97 	long long failed_secu;			/* blocked responses because of security concerns */
98 
99 	long long failed_checks, failed_hana;	/* failed health checks and health analyses for servers */
100 	long long down_trans;			/* up->down transitions */
101 
102 	unsigned int q_time, c_time, d_time, t_time; /* sums of conn_time, queue_time, data_time, total_time */
103 	unsigned int qtime_max, ctime_max, dtime_max, ttime_max; /* maximum of conn_time, queue_time, data_time, total_time observed */
104 
105 	union {
106 		struct {
107 			long long cum_req;      /* cumulated number of processed HTTP requests */
108 			long long comp_rsp;     /* number of compressed responses */
109 			unsigned int rps_max;   /* maximum of new HTTP requests second observed */
110 			long long rsp[6];       /* http response codes */
111 			long long cache_lookups;/* cache lookups */
112 			long long cache_hits;   /* cache hits */
113 		} http;
114 	} p;                                    /* protocol-specific stats */
115 };
116 
117 #endif /* _TYPES_COUNTERS_H */
118 
119 /*
120  * Local variables:
121  *  c-indent-level: 8
122  *  c-basic-offset: 8
123  * End:
124  */
125