blob: 172f8a6413b7dfb203902eaac2058c1373d502dc [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 Tarreau7d0aaf32011-03-10 23:25:56 +010026/* maybe later we might thing about having a different struct for FE and BE */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020027struct pxcounters {
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 */
31 long long cum_lbconn; /* cumulated number of sessions processed by load balancing (BE only) */
Bhaskar Maddalaa20cb852014-02-03 16:26:46 -050032 unsigned long last_sess; /* last session time */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020033
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010034 unsigned int cps_max; /* maximum of new connections received per second */
35 unsigned int sps_max; /* maximum of new connections accepted per second (sessions) */
36 unsigned int nbpend_max; /* max number of pending connections with no server assigned yet (BE only) */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020037
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010038 long long bytes_in; /* number of bytes transferred from the client to the server */
39 long long bytes_out; /* number of bytes transferred from the server to the client */
Willy Tarreauac68c5d2009-10-04 23:12:44 +020040
Willy Tarreau55058a72012-11-21 08:27:21 +010041 long long comp_in; /* input bytes fed to the compressor */
42 long long comp_out; /* output bytes emitted by the compressor */
43 long long comp_byp; /* input bytes that bypassed the compressor (cpu/ram/bw limitation) */
44
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010045 long long denied_req; /* blocked requests/responses because of security concerns */
46 long long denied_resp; /* blocked requests/responses because of security concerns */
47 long long failed_req; /* failed requests (eg: invalid or timeout) */
48 long long denied_conn; /* denied connection requests (tcp-req rules) */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020049
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010050 long long failed_conns; /* failed connect() attempts (BE only) */
51 long long failed_resp; /* failed responses (BE only) */
52 long long cli_aborts; /* aborted responses during DATA phase caused by the client */
53 long long srv_aborts; /* aborted responses during DATA phase caused by the server */
54 long long retries; /* retried and redispatched connections (BE only) */
55 long long redispatches; /* retried and redispatched connections (BE only) */
Willy Tarreaueabea072011-09-10 23:29:44 +020056 long long intercepted_req; /* number of monitoring or stats requests intercepted by the frontend */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020057
Willy Tarreau4bfc5802014-06-17 12:19:18 +020058 unsigned int q_time, c_time, d_time, t_time; /* sums of conn_time, queue_time, data_time, total_time */
59
Krzysztof Piotr Oledzki5fb18822009-10-13 21:14:09 +020060 union {
61 struct {
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010062 long long cum_req; /* cumulated number of processed HTTP requests */
Willy Tarreau5e16cbc2012-11-24 14:54:13 +010063 long long comp_rsp; /* number of compressed responses */
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010064 unsigned int rps_max; /* maximum of new HTTP requests second observed */
65 long long rsp[6]; /* http response codes */
Krzysztof Piotr Oledzki5fb18822009-10-13 21:14:09 +020066 } http;
Willy Tarreau7d0aaf32011-03-10 23:25:56 +010067 } p; /* protocol-specific stats */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020068};
69
70struct licounters {
71 unsigned int conn_max; /* max # of active listener sessions */
72
Willy Tarreaub36b4242010-06-04 20:59:39 +020073 long long cum_conn; /* cumulated number of received connections */
74 long long cum_sess; /* cumulated number of accepted sessions */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020075
76 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 */
78
79 long long denied_req, denied_resp; /* blocked requests/responses because of security concerns */
80 long long failed_req; /* failed requests (eg: invalid or timeout) */
Willy Tarreau2799e982010-06-05 15:43:21 +020081 long long denied_conn; /* denied connection requests (tcp-req rules) */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020082};
83
84struct srvcounters {
Willy Tarreauac68c5d2009-10-04 23:12:44 +020085 unsigned int cur_sess_max; /* max number of currently active sessions */
86 unsigned int nbpend_max; /* max number of pending connections reached */
87 unsigned int sps_max; /* maximum of new sessions per second seen on this server */
88
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020089 long long cum_sess; /* cumulated number of sessions really sent to this server */
90 long long cum_lbconn; /* cumulated number of sessions directed by load balancing */
Bhaskar Maddalaa20cb852014-02-03 16:26:46 -050091 unsigned long last_sess; /* last session time */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020092
93 long long bytes_in; /* number of bytes transferred from the client to the server */
94 long long bytes_out; /* number of bytes transferred from the server to the client */
95
96 long long failed_conns, failed_resp; /* failed connect() and responses */
Willy Tarreauae526782010-03-04 20:34:23 +010097 long long cli_aborts, srv_aborts; /* aborted responses during DATA phase due to client or server */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +020098 long long retries, redispatches; /* retried and redispatched connections */
99 long long failed_secu; /* blocked responses because of security concerns */
100
Willy Tarreau4bfc5802014-06-17 12:19:18 +0200101 unsigned int q_time, c_time, d_time, t_time; /* sums of conn_time, queue_time, data_time, total_time */
102
Krzysztof Piotr Oledzki5fb18822009-10-13 21:14:09 +0200103 union {
104 struct {
Willy Tarreau24657792010-02-26 10:30:28 +0100105 long long rsp[6]; /* http response codes */
Krzysztof Piotr Oledzki5fb18822009-10-13 21:14:09 +0200106 } http;
107 } p;
108
Krzysztof Piotr Oledzki97f07b82009-12-15 22:31:24 +0100109 long long failed_checks, failed_hana; /* failed health checks and health analyses */
110 long long down_trans; /* up->down transitions */
Krzysztof Piotr Oledzki8d06b8b2009-10-04 14:32:53 +0200111};
112
113#endif /* _TYPES_COUNTERS_H */
114
115/*
116 * Local variables:
117 * c-indent-level: 8
118 * c-basic-offset: 8
119 * End:
120 */