diff --git a/src/connection.c b/src/connection.c index 14645da6..61375d67 100644 --- a/src/connection.c +++ b/src/connection.c @@ -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) { diff --git a/src/slave.c b/src/slave.c index 8f4675eb..662e2a33 100644 --- a/src/slave.c +++ b/src/slave.c @@ -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); diff --git a/src/source.c b/src/source.c index a5926ee5..89d75bd6 100644 --- a/src/source.c +++ b/src/source.c @@ -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"); diff --git a/src/stats.c b/src/stats.c index fdd0c044..616204fe 100644 --- a/src/stats.c +++ b/src/stats.c @@ -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) {