mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
2a2938b68b
functions. call client_create in the general handler and pass client_t to the specific handler including the stats request handler, which now logs in the access log. svn path=/icecast/trunk/icecast/; revision=9220
99 lines
2.1 KiB
C
99 lines
2.1 KiB
C
/* 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).
|
|
*/
|
|
|
|
#ifndef __STATS_H__
|
|
#define __STATS_H__
|
|
|
|
#include "connection.h"
|
|
#include "httpp/httpp.h"
|
|
#include "client.h"
|
|
#include <libxml/xmlmemory.h>
|
|
#include <libxml/parser.h>
|
|
#include <libxml/tree.h>
|
|
|
|
|
|
typedef struct _stats_node_tag
|
|
{
|
|
char *name;
|
|
char *value;
|
|
int hidden;
|
|
} stats_node_t;
|
|
|
|
typedef struct _stats_event_tag
|
|
{
|
|
char *source;
|
|
char *name;
|
|
char *value;
|
|
int hidden;
|
|
int action;
|
|
|
|
struct _stats_event_tag *next;
|
|
} stats_event_t;
|
|
|
|
typedef struct _stats_source_tag
|
|
{
|
|
char *source;
|
|
int hidden;
|
|
avl_tree *stats_tree;
|
|
} stats_source_t;
|
|
|
|
typedef struct _stats_tag
|
|
{
|
|
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
|
|
*/
|
|
|
|
} stats_t;
|
|
|
|
void stats_initialize();
|
|
void stats_shutdown();
|
|
|
|
stats_t *stats_get_stats();
|
|
|
|
void stats_event(const char *source, const char *name, const char *value);
|
|
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);
|
|
void stats_event_dec(const char *source, const char *name);
|
|
void stats_event_hidden (const char *source, const char *name, int hidden);
|
|
|
|
void *stats_connection(void *arg);
|
|
void *stats_callback(void *arg);
|
|
|
|
void stats_transform_xslt(client_t *client, char *xslpath);
|
|
void stats_sendxml(client_t *client);
|
|
void stats_get_xml(xmlDocPtr *doc, int show_hidden);
|
|
char *stats_get_value(char *source, char *name);
|
|
|
|
#endif /* __STATS_H__ */
|
|
|
|
|
|
|
|
|
|
|