a bit more diskcache tracing

This commit is contained in:
Andrew Dolgov 2023-04-10 18:23:26 +03:00
parent f3f2e7d043
commit 8ccea1712e
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
1 changed files with 7 additions and 3 deletions

View File

@ -221,7 +221,7 @@ class DiskCache implements Cache_Adapter {
} }
public function remove(string $filename): bool { public function remove(string $filename): bool {
$scope = Tracer::start(__METHOD__); $scope = Tracer::start(__METHOD__, ['filename' => $filename]);
$rc = $this->adapter->remove($filename); $rc = $this->adapter->remove($filename);
$scope->close(); $scope->close();
@ -248,7 +248,7 @@ class DiskCache implements Cache_Adapter {
} }
public function exists(string $filename): bool { public function exists(string $filename): bool {
$scope = Tracer::start(__METHOD__); $scope = Tracer::start(__METHOD__, ['filename' => $filename]);
$rc = $this->adapter->exists(basename($filename)); $rc = $this->adapter->exists(basename($filename));
$scope->close(); $scope->close();
@ -259,7 +259,11 @@ class DiskCache implements Cache_Adapter {
* @return int|false -1 if the file doesn't exist, false if an error occurred, size in bytes otherwise * @return int|false -1 if the file doesn't exist, false if an error occurred, size in bytes otherwise
*/ */
public function get_size(string $filename) { public function get_size(string $filename) {
return $this->adapter->get_size(basename($filename)); $scope = Tracer::start(__METHOD__, ['filename' => $filename]);
$rc = $this->adapter->get_size(basename($filename));
$scope->close();
return $rc;
} }
/** /**