Index: memcache.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/memcache/memcache.inc,v
retrieving revision 1.7
diff -u -r1.7 memcache.inc
--- memcache.inc	2 Apr 2007 11:05:36 -0000	1.7
+++ memcache.inc	6 Apr 2007 09:58:39 -0000
@@ -1,6 +1,9 @@
 <?php
 // $ID$
 
+global $memcache_statistics;
+$memcache_statistics = array('get' => 0, 'hit' => 0, 'set' => 0);
+
 /*
  * A memcache API for Drupal.
  */
@@ -20,6 +23,8 @@
  * @return bool
  */
 function dmemcache_set($key, $value, $exp = 0, $bin = 'cache') {
+  global $memcache_statistics;
+  $memcache_statistics['set']++;
   if ($mc = dmemcache_object($bin)) {
     $full_key = dmemcache_key($key, $bin);
     if (!$mc->set($full_key, $value, FALSE, $exp)) {
@@ -41,9 +46,15 @@
  * @return The item which was originally saved or FALSE
  */
 function dmemcache_get($key, $bin = 'cache') {
+  global $memcache_statistics;
+  $memcache_statistics['get']++;
   if ($mc = dmemcache_object($bin)) {
     $full_key = dmemcache_key($key, $bin);
-    return $mc->get($full_key);
+    $value = $mc->get($full_key);
+    if ($value != FALSE) {
+      $memcache_statistics['hit']++;
+    }
+    return $value;
   }
 }
 
