Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 1 | /* |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 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> |
Willy Tarreau | 4bfc580 | 2014-06-17 12:19:18 +0200 | [diff] [blame] | 6 | * Copyright 2011-2014 Willy Tarreau <w@1wt.eu> |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 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 | */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 22 | |
| 23 | #ifndef _TYPES_COUNTERS_H |
| 24 | #define _TYPES_COUNTERS_H |
| 25 | |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 26 | /* counters used by listeners and frontends */ |
| 27 | struct fe_counters { |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 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 */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 31 | |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 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) */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 34 | |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 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 */ |
Willy Tarreau | ac68c5d | 2009-10-04 23:12:44 +0200 | [diff] [blame] | 37 | |
Willy Tarreau | 55058a7 | 2012-11-21 08:27:21 +0100 | [diff] [blame] | 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 | |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 42 | long long denied_req; /* blocked requests because of security concerns */ |
| 43 | long long denied_resp; /* blocked responses because of security concerns */ |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 44 | long long failed_req; /* failed requests (eg: invalid or timeout) */ |
Willy Tarreau | 27df66e | 2016-10-21 16:31:13 +0200 | [diff] [blame] | 45 | long long denied_conn; /* denied connection requests (tcp-req-conn rules) */ |
| 46 | long long denied_sess; /* denied session requests (tcp-req-sess rules) */ |
Tim Duesterhus | 3fd1973 | 2018-05-27 20:35:08 +0200 | [diff] [blame] | 47 | long long failed_rewrites; /* failed rewrites (warning) */ |
Christopher Faulet | d4ce6c2 | 2019-12-16 11:11:02 +0100 | [diff] [blame^] | 48 | long long internal_errors; /* internal processing errors */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 49 | |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 50 | long long cli_aborts; /* aborted responses during DATA phase caused by the client */ |
| 51 | long long srv_aborts; /* aborted responses during DATA phase caused by the server */ |
Willy Tarreau | eabea07 | 2011-09-10 23:29:44 +0200 | [diff] [blame] | 52 | long long intercepted_req; /* number of monitoring or stats requests intercepted by the frontend */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 53 | |
Krzysztof Piotr Oledzki | 5fb1882 | 2009-10-13 21:14:09 +0200 | [diff] [blame] | 54 | union { |
| 55 | struct { |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 56 | long long cum_req; /* cumulated number of processed HTTP requests */ |
Willy Tarreau | 5e16cbc | 2012-11-24 14:54:13 +0100 | [diff] [blame] | 57 | long long comp_rsp; /* number of compressed responses */ |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 58 | unsigned int rps_max; /* maximum of new HTTP requests second observed */ |
| 59 | long long rsp[6]; /* http response codes */ |
Willy Tarreau | a1214a5 | 2018-12-14 14:00:25 +0100 | [diff] [blame] | 60 | long long cache_lookups;/* cache lookups */ |
| 61 | long long cache_hits; /* cache hits */ |
Krzysztof Piotr Oledzki | 5fb1882 | 2009-10-13 21:14:09 +0200 | [diff] [blame] | 62 | } http; |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 63 | } p; /* protocol-specific stats */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 64 | }; |
| 65 | |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 66 | /* counters used by listeners and frontends */ |
| 67 | struct be_counters { |
| 68 | unsigned int conn_max; /* max # of active sessions */ |
| 69 | long long cum_conn; /* cumulated number of received connections */ |
| 70 | long long cum_sess; /* cumulated number of accepted connections */ |
| 71 | long long cum_lbconn; /* cumulated number of sessions processed by load balancing (BE only) */ |
| 72 | unsigned long last_sess; /* last session time */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 73 | |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 74 | unsigned int cps_max; /* maximum of new connections received per second */ |
| 75 | unsigned int sps_max; /* maximum of new connections accepted per second (sessions) */ |
| 76 | unsigned int nbpend_max; /* max number of pending connections with no server assigned yet (BE only) */ |
Willy Tarreau | ac68c5d | 2009-10-04 23:12:44 +0200 | [diff] [blame] | 77 | unsigned int cur_sess_max; /* max number of currently active sessions */ |
Willy Tarreau | ac68c5d | 2009-10-04 23:12:44 +0200 | [diff] [blame] | 78 | |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 79 | long long bytes_in; /* number of bytes transferred from the client to the server */ |
| 80 | long long bytes_out; /* number of bytes transferred from the server to the client */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 81 | |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 82 | long long comp_in; /* input bytes fed to the compressor */ |
| 83 | long long comp_out; /* output bytes emitted by the compressor */ |
| 84 | long long comp_byp; /* input bytes that bypassed the compressor (cpu/ram/bw limitation) */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 85 | |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 86 | long long denied_req; /* blocked requests because of security concerns */ |
| 87 | long long denied_resp; /* blocked responses because of security concerns */ |
| 88 | |
Willy Tarreau | f157384 | 2018-12-14 11:35:36 +0100 | [diff] [blame] | 89 | long long connect; /* number of connection establishment attempts */ |
| 90 | long long reuse; /* number of connection reuses */ |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 91 | long long failed_conns; /* failed connect() attempts (BE only) */ |
| 92 | long long failed_resp; /* failed responses (BE only) */ |
| 93 | long long cli_aborts; /* aborted responses during DATA phase caused by the client */ |
| 94 | long long srv_aborts; /* aborted responses during DATA phase caused by the server */ |
| 95 | long long retries; /* retried and redispatched connections (BE only) */ |
| 96 | long long redispatches; /* retried and redispatched connections (BE only) */ |
Tim Duesterhus | 3fd1973 | 2018-05-27 20:35:08 +0200 | [diff] [blame] | 97 | long long failed_rewrites; /* failed rewrites (warning) */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 98 | long long failed_secu; /* blocked responses because of security concerns */ |
Christopher Faulet | d4ce6c2 | 2019-12-16 11:11:02 +0100 | [diff] [blame^] | 99 | long long internal_errors; /* internal processing errors */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 100 | |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 101 | long long failed_checks, failed_hana; /* failed health checks and health analyses for servers */ |
| 102 | long long down_trans; /* up->down transitions */ |
| 103 | |
Willy Tarreau | 4bfc580 | 2014-06-17 12:19:18 +0200 | [diff] [blame] | 104 | unsigned int q_time, c_time, d_time, t_time; /* sums of conn_time, queue_time, data_time, total_time */ |
Christopher Faulet | efb41f0 | 2019-11-08 14:53:15 +0100 | [diff] [blame] | 105 | unsigned int qtime_max, ctime_max, dtime_max, ttime_max; /* maximum of conn_time, queue_time, data_time, total_time observed */ |
Willy Tarreau | 4bfc580 | 2014-06-17 12:19:18 +0200 | [diff] [blame] | 106 | |
Krzysztof Piotr Oledzki | 5fb1882 | 2009-10-13 21:14:09 +0200 | [diff] [blame] | 107 | union { |
| 108 | struct { |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 109 | long long cum_req; /* cumulated number of processed HTTP requests */ |
| 110 | long long comp_rsp; /* number of compressed responses */ |
| 111 | unsigned int rps_max; /* maximum of new HTTP requests second observed */ |
| 112 | long long rsp[6]; /* http response codes */ |
Willy Tarreau | a1214a5 | 2018-12-14 14:00:25 +0100 | [diff] [blame] | 113 | long long cache_lookups;/* cache lookups */ |
| 114 | long long cache_hits; /* cache hits */ |
Krzysztof Piotr Oledzki | 5fb1882 | 2009-10-13 21:14:09 +0200 | [diff] [blame] | 115 | } http; |
Willy Tarreau | ae9bea0 | 2016-11-25 14:44:52 +0100 | [diff] [blame] | 116 | } p; /* protocol-specific stats */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 117 | }; |
| 118 | |
| 119 | #endif /* _TYPES_COUNTERS_H */ |
| 120 | |
| 121 | /* |
| 122 | * Local variables: |
| 123 | * c-indent-level: 8 |
| 124 | * c-basic-offset: 8 |
| 125 | * End: |
| 126 | */ |