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> |
| 6 | * Copyright 2011 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 | */ |
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 | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 26 | /* maybe later we might thing about having a different struct for FE and BE */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 27 | struct pxcounters { |
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 */ |
| 31 | long long cum_lbconn; /* cumulated number of sessions processed by load balancing (BE only) */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 32 | |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 33 | unsigned int cps_max; /* maximum of new connections received per second */ |
| 34 | unsigned int sps_max; /* maximum of new connections accepted per second (sessions) */ |
| 35 | unsigned int nbpend_max; /* max number of pending connections with no server assigned yet (BE only) */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 36 | |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 37 | long long bytes_in; /* number of bytes transferred from the client to the server */ |
| 38 | 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] | 39 | |
Willy Tarreau | 55058a7 | 2012-11-21 08:27:21 +0100 | [diff] [blame] | 40 | long long comp_in; /* input bytes fed to the compressor */ |
| 41 | long long comp_out; /* output bytes emitted by the compressor */ |
| 42 | long long comp_byp; /* input bytes that bypassed the compressor (cpu/ram/bw limitation) */ |
| 43 | |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 44 | long long denied_req; /* blocked requests/responses because of security concerns */ |
| 45 | long long denied_resp; /* blocked requests/responses because of security concerns */ |
| 46 | long long failed_req; /* failed requests (eg: invalid or timeout) */ |
| 47 | long long denied_conn; /* denied connection requests (tcp-req rules) */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 48 | |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 49 | long long failed_conns; /* failed connect() attempts (BE only) */ |
| 50 | long long failed_resp; /* failed responses (BE only) */ |
| 51 | long long cli_aborts; /* aborted responses during DATA phase caused by the client */ |
| 52 | long long srv_aborts; /* aborted responses during DATA phase caused by the server */ |
| 53 | long long retries; /* retried and redispatched connections (BE only) */ |
| 54 | long long redispatches; /* retried and redispatched connections (BE only) */ |
Willy Tarreau | eabea07 | 2011-09-10 23:29:44 +0200 | [diff] [blame] | 55 | 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] | 56 | |
Krzysztof Piotr Oledzki | 5fb1882 | 2009-10-13 21:14:09 +0200 | [diff] [blame] | 57 | union { |
| 58 | struct { |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 59 | long long cum_req; /* cumulated number of processed HTTP requests */ |
Willy Tarreau | 5e16cbc | 2012-11-24 14:54:13 +0100 | [diff] [blame] | 60 | long long comp_rsp; /* number of compressed responses */ |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 61 | unsigned int rps_max; /* maximum of new HTTP requests second observed */ |
| 62 | long long rsp[6]; /* http response codes */ |
Krzysztof Piotr Oledzki | 5fb1882 | 2009-10-13 21:14:09 +0200 | [diff] [blame] | 63 | } http; |
Willy Tarreau | 7d0aaf3 | 2011-03-10 23:25:56 +0100 | [diff] [blame] | 64 | } p; /* protocol-specific stats */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | struct licounters { |
| 68 | unsigned int conn_max; /* max # of active listener sessions */ |
| 69 | |
Willy Tarreau | b36b424 | 2010-06-04 20:59:39 +0200 | [diff] [blame] | 70 | long long cum_conn; /* cumulated number of received connections */ |
| 71 | long long cum_sess; /* cumulated number of accepted sessions */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 72 | |
| 73 | long long bytes_in; /* number of bytes transferred from the client to the server */ |
| 74 | long long bytes_out; /* number of bytes transferred from the server to the client */ |
| 75 | |
| 76 | long long denied_req, denied_resp; /* blocked requests/responses because of security concerns */ |
| 77 | long long failed_req; /* failed requests (eg: invalid or timeout) */ |
Willy Tarreau | 2799e98 | 2010-06-05 15:43:21 +0200 | [diff] [blame] | 78 | long long denied_conn; /* denied connection requests (tcp-req rules) */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | struct srvcounters { |
Willy Tarreau | ac68c5d | 2009-10-04 23:12:44 +0200 | [diff] [blame] | 82 | unsigned int cur_sess_max; /* max number of currently active sessions */ |
| 83 | unsigned int nbpend_max; /* max number of pending connections reached */ |
| 84 | unsigned int sps_max; /* maximum of new sessions per second seen on this server */ |
| 85 | |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 86 | long long cum_sess; /* cumulated number of sessions really sent to this server */ |
| 87 | long long cum_lbconn; /* cumulated number of sessions directed by load balancing */ |
| 88 | |
| 89 | long long bytes_in; /* number of bytes transferred from the client to the server */ |
| 90 | long long bytes_out; /* number of bytes transferred from the server to the client */ |
| 91 | |
| 92 | long long failed_conns, failed_resp; /* failed connect() and responses */ |
Willy Tarreau | ae52678 | 2010-03-04 20:34:23 +0100 | [diff] [blame] | 93 | long long cli_aborts, srv_aborts; /* aborted responses during DATA phase due to client or server */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 94 | long long retries, redispatches; /* retried and redispatched connections */ |
| 95 | long long failed_secu; /* blocked responses because of security concerns */ |
| 96 | |
Krzysztof Piotr Oledzki | 5fb1882 | 2009-10-13 21:14:09 +0200 | [diff] [blame] | 97 | union { |
| 98 | struct { |
Willy Tarreau | 2465779 | 2010-02-26 10:30:28 +0100 | [diff] [blame] | 99 | long long rsp[6]; /* http response codes */ |
Krzysztof Piotr Oledzki | 5fb1882 | 2009-10-13 21:14:09 +0200 | [diff] [blame] | 100 | } http; |
| 101 | } p; |
| 102 | |
Krzysztof Piotr Oledzki | 97f07b8 | 2009-12-15 22:31:24 +0100 | [diff] [blame] | 103 | long long failed_checks, failed_hana; /* failed health checks and health analyses */ |
| 104 | long long down_trans; /* up->down transitions */ |
Krzysztof Piotr Oledzki | 8d06b8b | 2009-10-04 14:32:53 +0200 | [diff] [blame] | 105 | }; |
| 106 | |
| 107 | #endif /* _TYPES_COUNTERS_H */ |
| 108 | |
| 109 | /* |
| 110 | * Local variables: |
| 111 | * c-indent-level: 8 |
| 112 | * c-basic-offset: 8 |
| 113 | * End: |
| 114 | */ |