1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

add a few more informational stats

svn path=/icecast/trunk/icecast/; revision=9423
This commit is contained in:
Karl Heyes 2005-06-09 20:54:08 +00:00
parent e0da4c90a9
commit 84a0892cff
4 changed files with 12 additions and 2 deletions

View File

@ -953,6 +953,7 @@ static void _handle_get_request (client_t *client, char *passed_uri)
avl_tree_wlock(source->pending_tree); avl_tree_wlock(source->pending_tree);
avl_insert(source->pending_tree, (void *)client); avl_insert(source->pending_tree, (void *)client);
avl_tree_unlock(source->pending_tree); avl_tree_unlock(source->pending_tree);
stats_event_inc (NULL, "listener_connections");
if (source->running == 0 && source->on_demand) if (source->running == 0 && source->on_demand)
{ {

View File

@ -242,6 +242,7 @@ static void *start_relay_stream (void *arg)
break; break;
} }
stats_event_inc(NULL, "source_relay_connections"); stats_event_inc(NULL, "source_relay_connections");
stats_event (relay->localmount, "source_ip", relay->server);
source_main (relay->source); source_main (relay->source);

View File

@ -521,7 +521,9 @@ static void send_to_listener (source_t *source, client_t *client, int deletion_e
* if so, check to see if this client is still referring to it */ * if so, check to see if this client is still referring to it */
if (deletion_expected && client->refbuf && client->refbuf == source->stream_data) if (deletion_expected && client->refbuf && client->refbuf == source->stream_data)
{ {
DEBUG0("Client has fallen too far behind, removing"); INFO2 ("Client %lu (%s) has fallen too far behind, removing",
client->con->id, client->con->ip);
stats_event_inc (source->mount, "slow_listeners");
client->con->error = 1; client->con->error = 1;
} }
} }
@ -574,7 +576,7 @@ static void source_init (source_t *source)
source->listeners = 0; source->listeners = 0;
stats_event_inc (NULL, "sources"); stats_event_inc (NULL, "sources");
stats_event_inc (NULL, "source_total_connections"); stats_event_inc (NULL, "source_total_connections");
stats_event (source->mount, "listeners", "0"); stats_event (source->mount, "slow_listeners", "0");
sock_set_blocking (source->con->sock, SOCK_NONBLOCK); sock_set_blocking (source->con->sock, SOCK_NONBLOCK);
@ -1124,6 +1126,7 @@ void *source_client_thread (void *arg)
source_t *source = arg; source_t *source = arg;
const char ok_msg[] = "HTTP/1.0 200 OK\r\n\r\n"; const char ok_msg[] = "HTTP/1.0 200 OK\r\n\r\n";
int bytes; int bytes;
const char *agent;
source->client->respcode = 200; source->client->respcode = 200;
bytes = sock_write_bytes (source->client->con->sock, ok_msg, sizeof (ok_msg)-1); bytes = sock_write_bytes (source->client->con->sock, ok_msg, sizeof (ok_msg)-1);
@ -1136,6 +1139,10 @@ void *source_client_thread (void *arg)
source_free_source (source); source_free_source (source);
return NULL; return NULL;
} }
stats_event (source->mount, "source_ip", source->client->con->ip);
agent = httpp_getvar (source->client->parser, "user-agent");
if (agent)
stats_event (source->mount, "user_agent", agent);
stats_event_inc(NULL, "source_client_connections"); stats_event_inc(NULL, "source_client_connections");
stats_event (source->mount, "listeners", "0"); stats_event (source->mount, "listeners", "0");

View File

@ -553,6 +553,7 @@ static void *_stats_thread(void *arg)
stats_event (NULL, "source_relay_connections", "0"); stats_event (NULL, "source_relay_connections", "0");
stats_event (NULL, "source_total_connections", "0"); stats_event (NULL, "source_total_connections", "0");
stats_event (NULL, "stats_connections", "0"); stats_event (NULL, "stats_connections", "0");
stats_event (NULL, "listener_connections", "0");
INFO0 ("stats thread started"); INFO0 ("stats thread started");
while (_stats_running) { while (_stats_running) {