Index: dmemcache.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/memcache/dmemcache.inc,v
retrieving revision 1.1.4.10
diff -u -p -r1.1.4.10 dmemcache.inc
--- dmemcache.inc	25 Aug 2010 08:34:51 -0000	1.1.4.10
+++ dmemcache.inc	28 Sep 2010 16:56:47 -0000
@@ -10,7 +10,7 @@
  */
 
 global $_memcache_statistics;
-$_memcache_statistics = array('get' => array(), 'set' => array(), 'hit' => array());
+$_memcache_statistics = array();
 
 /*
  * A memcache API for Drupal.
@@ -35,10 +35,9 @@ $_memcache_statistics = array('get' => a
  */
 function dmemcache_set($key, $value, $exp = 0, $bin = 'cache', $mc = NULL) {
   global $_memcache_statistics;
-  $_memcache_statistics['set'][] = $key;
-  $_memcache_statistics['bins'][] = $bin;
+  $full_key = dmemcache_key($key, $bin);
+  $_memcache_statistics[] = array('set', $bin, $full_key, '');
   if ($mc || ($mc = dmemcache_object($bin))) {
-    $full_key = dmemcache_key($key, $bin);
     if (class_exists('Memcached')) {
       return $mc->set($full_key, $value, $exp);
     }
@@ -72,10 +71,9 @@ function dmemcache_set($key, $value, $ex
  */
 function dmemcache_add($key, $value, $exp = 0, $bin = 'cache', $mc = NULL, $flag = FALSE) {
   global $_memcache_statistics;
-  $_memcache_statistics['add'][] = $key;
-  $_memcache_statistics['bins'][] = $bin;
+  $full_key = dmemcache_key($key, $bin);
+  $_memcache_statistics[] = array('add', $bin, $full_key, '');
   if ($mc || ($mc = dmemcache_object($bin))) {
-    $full_key = dmemcache_key($key, $bin);
     if (class_exists('Memcached')) {
       return $mc->add($full_key, $value, $exp);
     }
@@ -96,16 +94,18 @@ function dmemcache_add($key, $value, $ex
  */
 function dmemcache_get($key, $bin = 'cache', $mc = NULL) {
   global $_memcache_statistics;
-  $_memcache_statistics['get'][] = $key;
-  $_memcache_statistics['bins'][] = $bin;
+  $full_key = dmemcache_key($key, $bin);
+  $statistics = array('get', $bin, $full_key);
+  $success = '0';
   if ($mc || ($mc = dmemcache_object($bin))) {
-    $full_key = dmemcache_key($key, $bin);
     $result = $mc->get($full_key);
     if ($result) {
-      $_memcache_statistics['hit'][] = $key;
-      return $result;
+      $success = '1';
     }
   }
+  $statistics[] = $success;
+  $_memcache_statistics[] = $statistics;
+  return $result;
 }
 
 /**
@@ -115,19 +115,18 @@ function dmemcache_get($key, $bin = 'cac
  * @param $bin The bin in which the item was stored.
  *
  * @return The item which was originally saved or FALSE
- *
- * TODO: Record statistics w/ multi-get
  */
 function dmemcache_get_multi($keys, $bin = 'cache', $mc = NULL) {
   global $_memcache_statistics;
-  $_memcache_statistics['get'] = array_merge($_memcache_statistics['get'], $keys);
-  $_memcache_statistics['bins'][] = $bin;
+  $full_keys = array();
+  $statistics = array();
+  foreach ($keys as $key => $cid) {
+    $full_key = dmemcache_key($cid, $bin);
+    $statistics[$full_key] = array('getMulti', $bin, $full_key);
+    $full_keys[] = $full_key;
+  }
   $results = array();
   if ($mc || ($mc = dmemcache_object($bin))) {
-    $full_keys = array();
-    foreach ($keys as $key => $cid) {
-      $full_keys[] = dmemcache_key($cid, $bin);
-    }
     if (class_exists('Memcached')) {
       $results = $mc->getMulti($full_keys);
     }
@@ -135,6 +134,10 @@ function dmemcache_get_multi($keys, $bin
       $results = $mc->get($full_keys);
     }
   }
+  foreach ($statistics as $key => $values) {
+    $values[] = isset($results[$key]) ? '1': '0';
+    $_memcache_statistics[] = $values;
+  }
   return $results;
 }
 
@@ -147,8 +150,10 @@ function dmemcache_get_multi($keys, $bin
  * @return Returns TRUE on success or FALSE on failure.
  */
 function dmemcache_delete($key, $bin = 'cache', $mc = NULL) {
+  global $_memcache_statistics;
+  $full_key = dmemcache_key($key, $bin);
+  $_memcache_statistics[] = array('delete', $bin, $full_key, '');
   if ($mc || ($mc = dmemcache_object($bin))) {
-    $full_key = dmemcache_key($key, $bin);
     return $mc->delete($full_key);
   }
   return FALSE;
@@ -165,6 +170,8 @@ function dmemcache_delete($key, $bin = '
  * @return Returns TRUE on success or FALSE on failure.
  */
 function dmemcache_flush($bin = 'cache', $mc = NULL) {
+  global $_memcache_statistics;
+  $_memcache_statistics[] = array('flush', $bin, '', '');
   if ($mc || ($mc = dmemcache_object($bin))) {
     return memcache_flush($mc);
   }
Index: memcache-lock.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/memcache/Attic/memcache-lock.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 memcache-lock.inc
--- memcache-lock.inc	28 Jun 2010 20:00:56 -0000	1.1.2.1
+++ memcache-lock.inc	28 Sep 2010 16:56:47 -0000
@@ -6,6 +6,8 @@
  * See includes/lock.inc for documenation
  */
 
+require_once dirname(__FILE__) . '/dmemcache.inc';
+
 // Set up a define to make the code more readable, so we know we're setting a
 // value for our lock and not simply passing dmemcache a flag.
 define('LOCK_VALUE', TRUE);
Index: memcache_admin/memcache_admin.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/memcache/memcache_admin/memcache_admin.module,v
retrieving revision 1.5.2.2
diff -u -p -r1.5.2.2 memcache_admin.module
--- memcache_admin/memcache_admin.module	23 Apr 2010 23:31:10 -0000	1.5.2.2
+++ memcache_admin/memcache_admin.module	28 Sep 2010 16:56:47 -0000
@@ -239,14 +239,10 @@ function memcache_admin_shutdown() {
   }
 
   if (variable_get('show_memcache_statistics', TRUE) && function_exists('user_access') && user_access('access memcache statistics')) {
-    $stats = array();
-
-    foreach ($_memcache_statistics as $stat => $value) {
-      $items = array('items' => $value);
-      $stats[] = "<strong>$stat:</strong> ". theme('item_list', array('items' => $value));
-    }
-    if (!empty($stats)) {
-      $output = theme('item_list', array('items' => $stats));
+    if (!empty($_memcache_statistics)) {
+      $variables = array('header' => array(t('Operation'), t('Bin'), t('Key'), t('Hit')),
+                         'rows' => $_memcache_statistics);
+      $output = theme('table', $variables);
 
       // this makes sure all of the HTML is within the <body> even though this <script> is outside it
       print '<div id="memcache-devel"><h2>'. t('Memcache statistics'). '</h2>'. $output. '</div>';
