Commit 84a0892c authored by Karl Heyes's avatar Karl Heyes

add a few more informational stats

svn path=/icecast/trunk/icecast/; revision=9423
parent e0da4c90
......@@ -953,6 +953,7 @@ static void _handle_get_request (client_t *client, char *passed_uri)
avl_tree_wlock(source->pending_tree);
avl_insert(source->pending_tree, (void *)client);
avl_tree_unlock(source->pending_tree);
stats_event_inc (NULL, "listener_connections");
if (source->running == 0 && source->on_demand)
{
......
......@@ -242,6 +242,7 @@ static void *start_relay_stream (void *arg)
break;
}
stats_event_inc(NULL, "source_relay_connections");
stats_event (relay->localmount, "source_ip", relay->server);
source_main (relay->source);
......
......@@ -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 (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;
}
}
......@@ -574,7 +576,7 @@ static void source_init (source_t *source)
source->listeners = 0;
stats_event_inc (NULL, "sources");
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);
......@@ -1124,6 +1126,7 @@ void *source_client_thread (void *arg)
source_t *source = arg;
const char ok_msg[] = "HTTP/1.0 200 OK\r\n\r\n";
int bytes;
const char *agent;
source->client->respcode = 200;
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);
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 (source->mount, "listeners", "0");
......
......@@ -553,6 +553,7 @@ static void *_stats_thread(void *arg)
stats_event (NULL, "source_relay_connections", "0");
stats_event (NULL, "source_total_connections", "0");
stats_event (NULL, "stats_connections", "0");
stats_event (NULL, "listener_connections", "0");
INFO0 ("stats thread started");
while (_stats_running) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment