[xiph-commits] r9423 - icecast/trunk/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Thu Jun 9 13:54:12 PDT 2005


Author: karl
Date: 2005-06-09 13:54:08 -0700 (Thu, 09 Jun 2005)
New Revision: 9423

Modified:
   icecast/trunk/icecast/src/connection.c
   icecast/trunk/icecast/src/slave.c
   icecast/trunk/icecast/src/source.c
   icecast/trunk/icecast/src/stats.c
Log:
add a few more informational stats


Modified: icecast/trunk/icecast/src/connection.c
===================================================================
--- icecast/trunk/icecast/src/connection.c	2005-06-09 16:03:08 UTC (rev 9422)
+++ icecast/trunk/icecast/src/connection.c	2005-06-09 20:54:08 UTC (rev 9423)
@@ -953,6 +953,7 @@
         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)
         {

Modified: icecast/trunk/icecast/src/slave.c
===================================================================
--- icecast/trunk/icecast/src/slave.c	2005-06-09 16:03:08 UTC (rev 9422)
+++ icecast/trunk/icecast/src/slave.c	2005-06-09 20:54:08 UTC (rev 9423)
@@ -242,6 +242,7 @@
             break;
         }
         stats_event_inc(NULL, "source_relay_connections");
+        stats_event (relay->localmount, "source_ip", relay->server);
 
         source_main (relay->source);
 

Modified: icecast/trunk/icecast/src/source.c
===================================================================
--- icecast/trunk/icecast/src/source.c	2005-06-09 16:03:08 UTC (rev 9422)
+++ icecast/trunk/icecast/src/source.c	2005-06-09 20:54:08 UTC (rev 9423)
@@ -521,7 +521,9 @@
      * 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 @@
     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 @@
     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 @@
         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");

Modified: icecast/trunk/icecast/src/stats.c
===================================================================
--- icecast/trunk/icecast/src/stats.c	2005-06-09 16:03:08 UTC (rev 9422)
+++ icecast/trunk/icecast/src/stats.c	2005-06-09 20:54:08 UTC (rev 9423)
@@ -553,6 +553,7 @@
     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) {



More information about the commits mailing list