2004-01-28 20:02:12 -05:00
|
|
|
/* Icecast
|
|
|
|
*
|
|
|
|
* This program is distributed under the GNU General Public License, version 2.
|
|
|
|
* A copy of this license is included with this source.
|
|
|
|
*
|
|
|
|
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
|
|
|
|
* Michael Smith <msmith@xiph.org>,
|
|
|
|
* oddsock <oddsock@xiph.org>,
|
|
|
|
* Karl Heyes <karl@xiph.org>
|
|
|
|
* and others (see AUTHORS for details).
|
|
|
|
*/
|
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
#ifndef __STATS_H__
|
|
|
|
#define __STATS_H__
|
|
|
|
|
2002-08-09 02:52:07 -04:00
|
|
|
#include <libxml/xmlmemory.h>
|
|
|
|
#include <libxml/parser.h>
|
|
|
|
#include <libxml/tree.h>
|
|
|
|
|
2018-06-17 08:28:38 -04:00
|
|
|
#include "icecasttypes.h"
|
|
|
|
#include "refbuf.h"
|
2002-02-11 04:11:18 -05:00
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
typedef struct _stats_node_tag
|
|
|
|
{
|
2003-03-14 21:10:19 -05:00
|
|
|
char *name;
|
|
|
|
char *value;
|
2004-11-22 13:21:48 -05:00
|
|
|
int hidden;
|
2001-09-09 22:21:46 -04:00
|
|
|
} stats_node_t;
|
|
|
|
|
|
|
|
typedef struct _stats_event_tag
|
|
|
|
{
|
2003-03-14 21:10:19 -05:00
|
|
|
char *source;
|
|
|
|
char *name;
|
|
|
|
char *value;
|
2004-11-22 13:21:48 -05:00
|
|
|
int hidden;
|
2004-10-25 10:03:42 -04:00
|
|
|
int action;
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2003-03-14 21:10:19 -05:00
|
|
|
struct _stats_event_tag *next;
|
2001-09-09 22:21:46 -04:00
|
|
|
} stats_event_t;
|
|
|
|
|
|
|
|
typedef struct _stats_source_tag
|
|
|
|
{
|
2003-03-14 21:10:19 -05:00
|
|
|
char *source;
|
2004-11-22 13:21:48 -05:00
|
|
|
int hidden;
|
2003-03-14 21:10:19 -05:00
|
|
|
avl_tree *stats_tree;
|
2001-09-09 22:21:46 -04:00
|
|
|
} stats_source_t;
|
|
|
|
|
|
|
|
typedef struct _stats_tag
|
|
|
|
{
|
2003-03-14 21:10:19 -05:00
|
|
|
avl_tree *global_tree;
|
|
|
|
|
|
|
|
/* global stats
|
|
|
|
start_time
|
|
|
|
total_users
|
|
|
|
max_users
|
|
|
|
total_sources
|
|
|
|
max_sources
|
|
|
|
total_user_connections
|
|
|
|
total_source_connections
|
|
|
|
*/
|
|
|
|
|
|
|
|
avl_tree *source_tree;
|
|
|
|
|
|
|
|
/* stats by source, and for stats
|
|
|
|
start_time
|
|
|
|
total_users
|
|
|
|
max_users
|
|
|
|
*/
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
} stats_t;
|
|
|
|
|
2005-12-17 07:23:09 -05:00
|
|
|
void stats_initialize(void);
|
|
|
|
void stats_shutdown(void);
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2007-08-15 22:13:18 -04:00
|
|
|
void stats_global(ice_config_t *config);
|
2005-12-17 07:23:09 -05:00
|
|
|
stats_t *stats_get_stats(void);
|
2008-04-29 00:50:23 -04:00
|
|
|
refbuf_t *stats_get_streams (void);
|
2007-08-11 13:44:45 -04:00
|
|
|
void stats_clear_virtual_mounts (void);
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2004-10-25 10:03:42 -04:00
|
|
|
void stats_event(const char *source, const char *name, const char *value);
|
2007-08-24 11:44:37 -04:00
|
|
|
void stats_event_conv(const char *mount, const char *name,
|
|
|
|
const char *value, const char *charset);
|
2004-10-25 10:03:42 -04:00
|
|
|
void stats_event_args(const char *source, char *name, char *format, ...);
|
|
|
|
void stats_event_inc(const char *source, const char *name);
|
|
|
|
void stats_event_add(const char *source, const char *name, unsigned long value);
|
2007-10-19 20:58:05 -04:00
|
|
|
void stats_event_sub(const char *source, const char *name, unsigned long value);
|
2004-10-25 10:03:42 -04:00
|
|
|
void stats_event_dec(const char *source, const char *name);
|
2004-11-22 13:21:48 -05:00
|
|
|
void stats_event_hidden (const char *source, const char *name, int hidden);
|
2005-06-10 21:24:58 -04:00
|
|
|
void stats_event_time (const char *mount, const char *name);
|
2014-05-04 03:14:54 -04:00
|
|
|
void stats_event_time_iso8601 (const char *mount, const char *name);
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
void *stats_connection(void *arg);
|
2005-08-12 11:27:32 -04:00
|
|
|
void stats_callback (client_t *client, void *notused);
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2005-06-18 06:54:53 -04:00
|
|
|
void stats_transform_xslt(client_t *client, const char *uri);
|
2001-09-09 22:21:46 -04:00
|
|
|
void stats_sendxml(client_t *client);
|
2018-05-19 03:41:45 -04:00
|
|
|
xmlDocPtr stats_get_xml(int show_hidden, const char *show_mount, client_t *client);
|
2007-08-28 22:01:28 -04:00
|
|
|
char *stats_get_value(const char *source, const char *name);
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
#endif /* __STATS_H__ */
|
|
|
|
|