summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
authorUrban Müller2015-10-19 18:20:00 +0200
committerUrban Müller2015-10-19 18:20:00 +0200
commit29852dbc1e993bc5115604ab21c253f7ffe6b0d3 (patch)
tree8ff9ace4f3b58a1929c574a5625982e816d6f1a9 /it_url.class
parent9460c349f967928a168cbcf004fcbb8bbf1760d8 (diff)
downloaditools-29852dbc1e993bc5115604ab21c253f7ffe6b0d3.tar.gz
itools-29852dbc1e993bc5115604ab21c253f7ffe6b0d3.tar.bz2
itools-29852dbc1e993bc5115604ab21c253f7ffe6b0d3.zip
optional cache hit rate logging
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class4
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;
}