blob: 2bdc3b1a82c62fba230ac8b9e227605816133819 [file] [log] [blame]
Willy Tarreau91861262007-10-17 17:06:05 +02001/*
Willy Tarreaueb472682010-05-28 18:46:57 +02002 * include/proto/dumpstats.h
3 * This file contains definitions of some primitives to dedicated to
4 * statistics output.
5 *
Willy Tarreaub24281b2011-02-13 13:16:36 +01006 * Copyright (C) 2000-2011 Willy Tarreau - w@1wt.eu
Willy Tarreaueb472682010-05-28 18:46:57 +02007 *
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 */
Willy Tarreau91861262007-10-17 17:06:05 +020022
23#ifndef _PROTO_DUMPSTATS_H
24#define _PROTO_DUMPSTATS_H
25
26#include <common/config.h>
Willy Tarreau8a8d83b2015-04-13 13:24:54 +020027#include <types/applet.h>
Willy Tarreauc7e42382012-08-24 19:22:53 +020028#include <types/stream_interface.h>
Willy Tarreau91861262007-10-17 17:06:05 +020029
Willy Tarreau295a8372011-03-10 11:25:07 +010030/* Flags for applet.ctx.stats.flags */
Willy Tarreau354898b2012-12-23 18:15:23 +010031#define STAT_FMT_HTML 0x00000001 /* dump the stats in HTML format */
Willy Tarreau39f7e6d2008-03-17 21:38:24 +010032#define STAT_HIDE_DOWN 0x00000008 /* hide 'down' servers in the stats page */
33#define STAT_NO_REFRESH 0x00000010 /* do not automatically refresh the stats page */
Cyril Bonté474be412010-10-12 00:14:36 +020034#define STAT_ADMIN 0x00000020 /* indicate a stats admin level */
Willy Tarreauaf3cf702014-04-22 22:19:53 +020035#define STAT_CHUNKED 0x00000040 /* use chunked encoding (HTTP/1.1) */
Willy Tarreau39f7e6d2008-03-17 21:38:24 +010036#define STAT_BOUND 0x00800000 /* bound statistics to selected proxies/types/services */
Willy Tarreau55bb8452007-10-17 18:44:57 +020037
Krzysztof Piotr Oledzki2c6962c2008-03-02 02:42:14 +010038#define STATS_TYPE_FE 0
39#define STATS_TYPE_BE 1
40#define STATS_TYPE_SV 2
Krzysztof Piotr Oledzkiaeebf9b2009-10-04 15:43:17 +020041#define STATS_TYPE_SO 3
Krzysztof Piotr Oledzki2c6962c2008-03-02 02:42:14 +010042
Willy Tarreau96d44912013-11-22 12:25:24 +010043/* HTTP stats : applet.st0 */
44enum {
45 STAT_HTTP_DONE = 0, /* finished */
Willy Tarreau347a35d2013-11-22 17:51:09 +010046 STAT_HTTP_HEAD, /* send headers before dump */
Willy Tarreau96d44912013-11-22 12:25:24 +010047 STAT_HTTP_DUMP, /* dumping stats */
Willy Tarreau347a35d2013-11-22 17:51:09 +010048 STAT_HTTP_POST, /* waiting post data */
49 STAT_HTTP_LAST, /* sending last chunk of response */
Willy Tarreau96d44912013-11-22 12:25:24 +010050};
51
de Lafond Guillaume88c278f2013-04-15 19:27:10 +020052/* HTML form to limit output scope */
53#define STAT_SCOPE_TXT_MAXLEN 20 /* max len for scope substring */
54#define STAT_SCOPE_INPUT_NAME "scope" /* pattern form scope name <input> in html form */
55#define STAT_SCOPE_PATTERN "?" STAT_SCOPE_INPUT_NAME "="
56
Willy Tarreau30576452015-04-13 13:50:30 +020057extern struct applet http_stats_applet;
Willy Tarreaub1356cf2008-12-07 16:06:43 +010058
Willy Tarreau9a42c0d2009-09-22 19:31:03 +020059void stats_io_handler(struct stream_interface *si);
Willy Tarreau91861262007-10-17 17:06:05 +020060
61
62#endif /* _PROTO_DUMPSTATS_H */
63
64/*
65 * Local variables:
66 * c-indent-level: 8
67 * c-basic-offset: 8
68 * End:
69 */