blob: 79dd6d437607353a119db710eae7e57ee299ee34 [file] [log] [blame]
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +02001/*
Willy Tarreau7d0aaf32011-03-10 23:25:56 +01002 * include/types/counters.h
3 * This file contains structure declarations for statistics counters.
4 *
5 * Copyright 2008-2009 Krzysztof Piotr Oledzki <ole@ans.pl>
Willy Tarreau4bfc5802014-06-17 12:19:18 +02006 * Copyright 2011-2014 Willy Tarreau <w@1wt.eu>
Willy Tarreau7d0aaf32011-03-10 23:25:56 +01007 *
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 */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020022
23#ifndef _TYPES_COUNTERS_H
24#define _TYPES_COUNTERS_H
25
Willy Tarreauae9bea02016-11-25 14:44:52 +010026/* counters used by listeners and frontends */
27struct fe_counters {
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010028 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 */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020031
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010032 unsigned int cps_max; /* maximum of new connections received per second */
33 unsigned int sps_max; /* maximum of new connections accepted per second (sessions) */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020034
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010035 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 */
Willy Tarreauac68c5d2009-10-04 23:12:44 +020037
Willy Tarreau55058a72012-11-21 08:27:21 +010038 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
Willy Tarreauae9bea02016-11-25 14:44:52 +010042 long long denied_req; /* blocked requests because of security concerns */
43 long long denied_resp; /* blocked responses because of security concerns */
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010044 long long failed_req; /* failed requests (eg: invalid or timeout) */
Willy Tarreau27df66e2016-10-21 16:31:13 +020045 long long denied_conn; /* denied connection requests (tcp-req-conn rules) */
46 long long denied_sess; /* denied session requests (tcp-req-sess rules) */
Tim Duesterhus3fd19732018-05-27 20:35:08 +020047 long long failed_rewrites; /* failed rewrites (warning) */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020048
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010049 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 */
Willy Tarreaueabea072011-09-10 23:29:44 +020051 long long intercepted_req; /* number of monitoring or stats requests intercepted by the frontend */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020052
Krzysztof Piotr Oledzki5fb18822009-10-13 21:14:09 +020053 union {
54 struct {
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010055 long long cum_req; /* cumulated number of processed HTTP requests */
Willy Tarreau5e16cbc2012-11-24 14:54:13 +010056 long long comp_rsp; /* number of compressed responses */
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010057 unsigned int rps_max; /* maximum of new HTTP requests second observed */
58 long long rsp[6]; /* http response codes */
Krzysztof Piotr Oledzki5fb18822009-10-13 21:14:09 +020059 } http;
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010060 } p; /* protocol-specific stats */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020061};
62
Willy Tarreauae9bea02016-11-25 14:44:52 +010063/* counters used by listeners and frontends */
64struct be_counters {
65 unsigned int conn_max; /* max # of active sessions */
66 long long cum_conn; /* cumulated number of received connections */
67 long long cum_sess; /* cumulated number of accepted connections */
68 long long cum_lbconn; /* cumulated number of sessions processed by load balancing (BE only) */
69 unsigned long last_sess; /* last session time */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020070
Willy Tarreauae9bea02016-11-25 14:44:52 +010071 unsigned int cps_max; /* maximum of new connections received per second */
72 unsigned int sps_max; /* maximum of new connections accepted per second (sessions) */
73 unsigned int nbpend_max; /* max number of pending connections with no server assigned yet (BE only) */
Willy Tarreauac68c5d2009-10-04 23:12:44 +020074 unsigned int cur_sess_max; /* max number of currently active sessions */
Willy Tarreauac68c5d2009-10-04 23:12:44 +020075
Willy Tarreauae9bea02016-11-25 14:44:52 +010076 long long bytes_in; /* number of bytes transferred from the client to the server */
77 long long bytes_out; /* number of bytes transferred from the server to the client */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020078
Willy Tarreauae9bea02016-11-25 14:44:52 +010079 long long comp_in; /* input bytes fed to the compressor */
80 long long comp_out; /* output bytes emitted by the compressor */
81 long long comp_byp; /* input bytes that bypassed the compressor (cpu/ram/bw limitation) */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020082
Willy Tarreauae9bea02016-11-25 14:44:52 +010083 long long denied_req; /* blocked requests because of security concerns */
84 long long denied_resp; /* blocked responses because of security concerns */
85
Willy Tarreauf1573842018-12-14 11:35:36 +010086 long long connect; /* number of connection establishment attempts */
87 long long reuse; /* number of connection reuses */
Willy Tarreauae9bea02016-11-25 14:44:52 +010088 long long failed_conns; /* failed connect() attempts (BE only) */
89 long long failed_resp; /* failed responses (BE only) */
90 long long cli_aborts; /* aborted responses during DATA phase caused by the client */
91 long long srv_aborts; /* aborted responses during DATA phase caused by the server */
92 long long retries; /* retried and redispatched connections (BE only) */
93 long long redispatches; /* retried and redispatched connections (BE only) */
Tim Duesterhus3fd19732018-05-27 20:35:08 +020094 long long failed_rewrites; /* failed rewrites (warning) */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020095 long long failed_secu; /* blocked responses because of security concerns */
96
Willy Tarreauae9bea02016-11-25 14:44:52 +010097 long long failed_checks, failed_hana; /* failed health checks and health analyses for servers */
98 long long down_trans; /* up->down transitions */
99
Willy Tarreau4bfc5802014-06-17 12:19:18 +0200100 unsigned int q_time, c_time, d_time, t_time; /* sums of conn_time, queue_time, data_time, total_time */
101
Krzysztof Piotr Oledzki5fb18822009-10-13 21:14:09 +0200102 union {
103 struct {
Willy Tarreauae9bea02016-11-25 14:44:52 +0100104 long long cum_req; /* cumulated number of processed HTTP requests */
105 long long comp_rsp; /* number of compressed responses */
106 unsigned int rps_max; /* maximum of new HTTP requests second observed */
107 long long rsp[6]; /* http response codes */
Krzysztof Piotr Oledzki5fb18822009-10-13 21:14:09 +0200108 } http;
Willy Tarreauae9bea02016-11-25 14:44:52 +0100109 } p; /* protocol-specific stats */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +0200110};
111
112#endif /* _TYPES_COUNTERS_H */
113
114/*
115 * Local variables:
116 * c-indent-level: 8
117 * c-basic-offset: 8
118 * End:
119 */