blob: 7a92c987da9419f37508db1a344f13ce38247f0f [file] [log] [blame]
Willy Tarreau91861262007-10-17 17:06:05 +02001/*
2 include/proto/dumpstats.h
3 This file contains definitions of some primitives to dedicated to
4 statistics output.
5
Willy Tarreau9a42c0d2009-09-22 19:31:03 +02006 Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu
Willy Tarreaub1356cf2008-12-07 16:06:43 +01007
Willy Tarreau91861262007-10-17 17:06:05 +02008 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*/
22
23#ifndef _PROTO_DUMPSTATS_H
24#define _PROTO_DUMPSTATS_H
25
26#include <common/config.h>
27#include <types/buffers.h>
28#include <types/session.h>
29
Willy Tarreau39f7e6d2008-03-17 21:38:24 +010030/* Flags for session->data_ctx.stats.flags */
31#define STAT_FMT_CSV 0x00000001 /* dump the stats in CSV format instead of HTML */
32#define STAT_SHOW_STAT 0x00000002 /* dump the stats part */
33#define STAT_SHOW_INFO 0x00000004 /* dump the info part */
34#define STAT_HIDE_DOWN 0x00000008 /* hide 'down' servers in the stats page */
35#define STAT_NO_REFRESH 0x00000010 /* do not automatically refresh the stats page */
36#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
41
Willy Tarreaub1356cf2008-12-07 16:06:43 +010042#define STATS_ST_INIT 0
43#define STATS_ST_REQ 1
44#define STATS_ST_REP 2
45#define STATS_ST_CLOSE 3
46
Willy Tarreau9a42c0d2009-09-22 19:31:03 +020047int stats_sock_parse_request(struct stream_interface *si, char *line);
48void stats_io_handler(struct stream_interface *si);
Willy Tarreau0a464892008-12-07 18:30:00 +010049int stats_dump_raw(struct session *s, struct buffer *rep, struct uri_auth *uri);
Willy Tarreau01bf8672008-12-07 18:03:29 +010050void stats_dump_raw_to_buffer(struct session *s, struct buffer *req);
Willy Tarreau0a464892008-12-07 18:30:00 +010051int stats_dump_http(struct session *s, struct buffer *rep, struct uri_auth *uri);
Willy Tarreau39f7e6d2008-03-17 21:38:24 +010052int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri);
Willy Tarreau3dfe6cd2008-12-07 22:29:48 +010053void stats_dump_sess_to_buffer(struct session *s, struct buffer *rep);
Willy Tarreau74808cb2009-03-04 15:53:18 +010054void stats_dump_errors_to_buffer(struct session *s, struct buffer *rep);
Willy Tarreau91861262007-10-17 17:06:05 +020055
56
57#endif /* _PROTO_DUMPSTATS_H */
58
59/*
60 * Local variables:
61 * c-indent-level: 8
62 * c-basic-offset: 8
63 * End:
64 */