--- /home/thomas/memcache/memcache_admin/memcache_admin.module	2008-08-11 12:22:50.820383544 -0400
+++ memcache_admin.module	2008-08-11 12:22:06.636383330 -0400
@@ -59,7 +59,17 @@
       $clusters[$cluster]['bin'] = _memcache_admin_get_bin_for_cluster($cluster);
     }
 
-    $count = 0;
+        $items[] = array(
+          'path' => 'admin/logs/memcache/overview',
+          'type' =>  MENU_DEFAULT_LOCAL_TASK,
+          'callback' => 'memcache_admin_stats',
+          'title' => t('Overview'),
+          'access' => user_access('access memcache statistics'),
+          'weight' => 0,
+        );
+
+
+    $count = 1;
     foreach ($clusters as $cluster => $cluster_info) {
       if ($cluster_info['bin']) {
         if (empty($current_cluster)) {
@@ -71,7 +81,7 @@
 
         $items[] = array(
           'path' => 'admin/logs/memcache/' . $cluster,
-          'type' =>  $count == 0 ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
+          'type' =>  MENU_LOCAL_TASK,
           'callback' => 'memcache_admin_stats',
           'callback arguments' => array($cluster),
           'title' => $cluster,
@@ -116,13 +126,79 @@
 }
 
 /**
+ * Memcache Stats Overview
+ * 
+ * @return string
+ */
+function memcache_admin_stats_overview(){
+  $servers = variable_get('memcache_servers', array());
+  $m = new Memcache;
+
+  $bins = array();
+  foreach ($servers as $server => $bin){
+    list($host, $port) = explode(':', $server);
+    if (@$m->connect($host, $port)){
+      $bins[$bin][] = $m->getStats();
+      $m->close();
+    }
+    else {
+      drupal_set_message("Could not connect to memcached server at $host:$port", 'error');
+    }
+  }
+  unset($m);
+
+  $stats = array();
+  foreach ($bins as $bin => $vals){
+    foreach(array('get_hits', 'get_misses', 'bytes', 'limit_maxbytes') as $item){
+      foreach($vals as $val){
+        $stats[$bin][$item] += $val[$item];
+      }
+    }
+  }
+
+  // Use poll module's css and markup
+  drupal_add_css(drupal_get_path('module', 'poll') .'/poll.css');
+  $output  .= '<div class="poll">';
+
+  foreach ($stats as $bin => $items){
+    $hit = 0;
+    if ($items['get_hits'] + $items['get_misses'] != 0){
+      $hit = round($items['get_hits'] / ($items['get_hits'] + $items['get_misses']) * 100, 2);
+    }
+    if ($items['limit_maxbytes'] != 0){
+      $size = round($items['bytes'] / $items['limit_maxbytes'] * 100, 2);
+    }
+    $use = round($items['bytes'] / 1048576, 2);
+    $max = round($items['limit_maxbytes'] / 1048576, 2);
+
+    $output .= '<div class="text" style="margin-top: 12px"><strong>'. $bin .'</strong></div>';
+
+    $output .= '<div class="bar"><div class="foreground" style="width: '. $hit .'%;"></div></div>';
+    $output .= '<div class="percent">Hit Rate: '. $hit .'%</div>';
+
+    $output .= '<div class="bar"><div class="foreground" style="width: '. $size .'%;"></div></div>';
+    $output .= '<div class="percent">Memory Usage: '. $size .'% ('. $use .'/'. $max .' MB)</div>';
+
+  }
+
+  $output .= '</div>';
+
+  return $output;
+
+}
+
+
+/**
  * Memcahe Stats page
  *
  * @param string $cluster - which cluster to view?
  * @param string $type - which type of stat, eg: default, reset, malloc, maps, cachedump, slabs, items or sizes
  * @return string
  */
-function memcache_admin_stats($cluster = 'default', $type = 'default') {
+function memcache_admin_stats($cluster = 'overview', $type = 'default') {
+  if ($cluster == 'overview'){
+    return memcache_admin_stats_overview();
+  }
   $bin = _memcache_admin_get_bin_for_cluster($cluster);
 
   if ($bin) {
