Skip to content
Snippets Groups Projects
Commit 33c1bd61 authored by Ben Coburn's avatar Ben Coburn
Browse files

Store cache hits only while debugging

Reduce overhead by only storing cache hit stats while
the allowdebug option is enabled.

darcs-hash:20060917230403-05dcb-92afea926b5a3fc302327f964e482787aec2d982.gz
parent 76aa94b7
No related branches found
No related tags found
No related merge requests found
......@@ -118,7 +118,8 @@ class cache {
}
/**
* record cache hits statistics
* Record cache hits statistics.
* (Only when debugging allowed, to reduce overhead.)
*
* @param bool $success result of this cache use attempt
* @return bool pass-thru $success value
......@@ -128,6 +129,8 @@ class cache {
static $stats = NULL;
static $file;
if (!$conf['allowdebug']) { return $success; }
if (is_null($stats)) {
$file = $conf['cachedir'].'/cache_stats.txt';
$lines = explode("\n",io_readFile($file));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment