diff options
author | Urban Müller | 2015-10-19 18:20:00 +0200 |
---|---|---|
committer | Urban Müller | 2015-10-19 18:20:00 +0200 |
commit | 29852dbc1e993bc5115604ab21c253f7ffe6b0d3 (patch) | |
tree | 8ff9ace4f3b58a1929c574a5625982e816d6f1a9 | |
parent | 9460c349f967928a168cbcf004fcbb8bbf1760d8 (diff) | |
download | itools-29852dbc1e993bc5115604ab21c253f7ffe6b0d3.tar.gz itools-29852dbc1e993bc5115604ab21c253f7ffe6b0d3.tar.bz2 itools-29852dbc1e993bc5115604ab21c253f7ffe6b0d3.zip |
optional cache hit rate logging
-rw-r--r-- | it_url.class | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/it_url.class b/it_url.class index 0f44639..a54d1f6 100644 --- a/it_url.class +++ b/it_url.class @@ -628,6 +628,7 @@ function get_cache($p = array()) $result = file_exists($path); } + $cachemiss = 1; it_url::_unlock($path, $lock); } else @@ -647,6 +648,9 @@ function get_cache($p = array()) exec("nohup bash -c 'cd {$p['cachedir']} && sleep 10 && find ?? -mmin +$maxagemin -print0 | xargs -0 -r rm' </dev/null >/dev/null 2>&1 &"); } + if (EDC('getcachelog')) + it::log('debug', 'getcachelog', "miss=" . intval($cachemiss), $p['url']); + ### EDC('getcache', $result, $path); # too verbose return $result ? ($p['returnheaders'] ? array($path, $headers) : $path) : false; } |