]>
Commit | Line | Data |
---|---|---|
212380e3 AC |
1 | /* |
2 | * ircd-ratbox: A slightly useful ircd. | |
3 | * s_stats.h: A header for the statistics functions. | |
4 | * | |
5 | * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center | |
6 | * Copyright (C) 1996-2002 Hybrid Development Team | |
7 | * Copyright (C) 2002-2004 ircd-ratbox development team | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation; either version 2 of the License, or | |
12 | * (at your option) any later version. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | |
22 | * USA | |
23 | * | |
24 | * $Id: s_stats.h 1409 2006-05-21 14:46:17Z jilles $ | |
25 | */ | |
26 | ||
27 | #ifndef INCLUDED_s_stats_h | |
28 | #define INCLUDED_s_stats_h | |
29 | ||
212380e3 AC |
30 | #define _1MEG (1024.0) |
31 | #define _1GIG (1024.0*1024.0) | |
32 | #define _1TER (1024.0*1024.0*1024.0) | |
33 | #define _GMKs(x) ( (x > _1TER) ? "Terabytes" : ((x > _1GIG) ? "Gigabytes" : \ | |
34 | ((x > _1MEG) ? "Megabytes" : "Kilobytes"))) | |
35 | #define _GMKv(x) ( (x > _1TER) ? (float)(x/_1TER) : ((x > _1GIG) ? \ | |
36 | (float)(x/_1GIG) : ((x > _1MEG) ? (float)(x/_1MEG) : (float)x))) | |
37 | ||
38 | struct Client; | |
39 | ||
40 | /* | |
41 | * statistics structures | |
42 | */ | |
43 | struct ServerStatistics | |
44 | { | |
45 | unsigned int is_cl; /* number of client connections */ | |
46 | unsigned int is_sv; /* number of server connections */ | |
47 | unsigned int is_ni; /* connection but no idea who it was */ | |
8bd5767b JT |
48 | unsigned long long int is_cbs; /* bytes sent to clients */ |
49 | unsigned long long int is_cbr; /* bytes received to clients */ | |
50 | unsigned long long int is_sbs; /* bytes sent to servers */ | |
4c79bbd3 | 51 | unsigned long long int is_sbr; /* bytes received to servers */ |
679ccbe5 AS |
52 | unsigned long long int is_cti; /* time spent connected by clients */ |
53 | unsigned long long int is_sti; /* time spent connected by servers */ | |
212380e3 AC |
54 | unsigned int is_ac; /* connections accepted */ |
55 | unsigned int is_ref; /* accepts refused */ | |
56 | unsigned int is_unco; /* unknown commands */ | |
57 | unsigned int is_wrdi; /* command going in wrong direction */ | |
58 | unsigned int is_unpf; /* unknown prefix */ | |
59 | unsigned int is_empt; /* empty message */ | |
60 | unsigned int is_num; /* numeric message */ | |
61 | unsigned int is_kill; /* number of kills generated on collisions */ | |
62 | unsigned int is_save; /* number of saves generated on collisions */ | |
63 | unsigned int is_asuc; /* successful auth requests */ | |
64 | unsigned int is_abad; /* bad auth requests */ | |
65 | unsigned int is_rej; /* rejected from cache */ | |
ae09cb7d | 66 | unsigned int is_thr; /* number of throttled connections */ |
212380e3 AC |
67 | unsigned int is_ssuc; /* successful sasl authentications */ |
68 | unsigned int is_sbad; /* failed sasl authentications */ | |
43f8445d | 69 | unsigned int is_tgch; /* messages blocked due to target change */ |
e88a1f1b | 70 | unsigned int is_rl; /* commands blocked due to ratelimit */ |
212380e3 AC |
71 | }; |
72 | ||
47adde3d | 73 | extern struct ServerStatistics ServerStats; |
212380e3 AC |
74 | |
75 | #endif /* INCLUDED_s_stats_h */ |