1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-02-02 15:07:36 -05:00

add general information to stats

svn path=/icecast/trunk/icecast/; revision=13553
This commit is contained in:
Karl Heyes 2007-08-16 02:13:18 +00:00
parent be75324e6c
commit eebb33b8a1
4 changed files with 19 additions and 8 deletions

View File

@ -24,6 +24,7 @@
#include "logging.h" #include "logging.h"
#include "slave.h" #include "slave.h"
#include "fserve.h" #include "fserve.h"
#include "stats.h"
#define CATMODULE "event" #define CATMODULE "event"
@ -60,10 +61,11 @@ void event_config_read(void *arg)
else { else {
config_clear(config); config_clear(config);
config_set_config(&new_config); config_set_config(&new_config);
restart_logging (config_get_config_unlocked()); config = config_get_config_unlocked();
yp_recheck_config (config_get_config_unlocked()); restart_logging (config);
fserve_recheck_mime_types (config_get_config_unlocked()); yp_recheck_config (config);
fserve_recheck_mime_types (config);
stats_global (config);
config_release_config(); config_release_config();
slave_recheck_all(); slave_recheck_all();
} }

View File

@ -679,6 +679,9 @@ static void *_slave_thread(void *arg)
update_settings = 0; update_settings = 0;
update_streams = 0; update_streams = 0;
config = config_get_config();
stats_global (config);
config_release_config();
source_recheck_mounts (1); source_recheck_mounts (1);
while (1) while (1)

View File

@ -543,6 +543,14 @@ void stats_event_time (const char *mount, const char *name)
} }
void stats_global (ice_config_t *config)
{
stats_event (NULL, "host", config->hostname);
stats_event (NULL, "location", config->location);
stats_event (NULL, "admin", config->admin);
}
static void *_stats_thread(void *arg) static void *_stats_thread(void *arg)
{ {
stats_event_t *event; stats_event_t *event;

View File

@ -13,6 +13,7 @@
#ifndef __STATS_H__ #ifndef __STATS_H__
#define __STATS_H__ #define __STATS_H__
#include "cfgfile.h"
#include "connection.h" #include "connection.h"
#include "httpp/httpp.h" #include "httpp/httpp.h"
#include "client.h" #include "client.h"
@ -73,6 +74,7 @@ typedef struct _stats_tag
void stats_initialize(void); void stats_initialize(void);
void stats_shutdown(void); void stats_shutdown(void);
void stats_global(ice_config_t *config);
stats_t *stats_get_stats(void); stats_t *stats_get_stats(void);
void stats_get_streamlist (char *buffer, size_t remaining); void stats_get_streamlist (char *buffer, size_t remaining);
void stats_clear_virtual_mounts (void); void stats_clear_virtual_mounts (void);
@ -95,7 +97,3 @@ char *stats_get_value(char *source, char *name);
#endif /* __STATS_H__ */ #endif /* __STATS_H__ */