Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 366)
+++ /trunk/xcache.c	(revision 374)
@@ -1964,4 +1964,5 @@
 	xc_entry_data_var_t var;
 	zval *name;
+	int found = 0;
 
 	if (!xc_var_caches) {
@@ -1980,4 +1981,5 @@
 		if (stored_xce) {
 			if (!VAR_ENTRY_EXPIRED(stored_xce)) {
+				found = 1;
 				xc_processor_restore_zval(return_value, stored_xce->data.var->value, stored_xce->data.var->have_references TSRMLS_CC);
 				/* return */
@@ -1991,4 +1993,10 @@
 		RETVAL_NULL();
 	} LEAVE_LOCK(xce.cache);
+	if (found) {
+		xce.cache->hits ++;
+	}
+	else {
+		xce.cache->misses ++;
+	}
 }
 /* }}} */
@@ -2037,4 +2045,5 @@
 	xc_entry_data_var_t var;
 	zval *name;
+	int found = 0;
 
 	if (!xc_var_caches) {
@@ -2053,4 +2062,5 @@
 		if (stored_xce) {
 			if (!VAR_ENTRY_EXPIRED(stored_xce)) {
+				found = 1;
 				RETVAL_TRUE;
 				/* return */
@@ -2064,4 +2074,10 @@
 		RETVAL_FALSE;
 	} LEAVE_LOCK(xce.cache);
+	if (found) {
+		xce.cache->hits ++;
+	}
+	else {
+		xce.cache->misses ++;
+	}
 }
 /* }}} */
