Merge pull request #34188 from nextcloud/feat/profiler-clear

Expose clearing the profiles and fix it
This commit is contained in:
Carl Schwan 2022-10-14 17:35:28 +02:00 committed by GitHub
commit f52bdfadf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View file

@ -99,6 +99,7 @@ class FileProfilerStorage {
$iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST);
foreach ($iterator as $file) {
$file = $file->getPathInfo();
if (is_file($file)) {
unlink($file);
} else {

View file

@ -102,4 +102,8 @@ class Profiler implements IProfiler {
public function setEnabled(bool $enabled): void {
$this->enabled = $enabled;
}
public function clear(): void {
$this->storage->purge();
}
}

View file

@ -98,4 +98,10 @@ interface IProfiler {
* @since 24.0.0
*/
public function collect(Request $request, Response $response): IProfile;
/**
* Clear the stored profiles
* @since 25.0.0
*/
public function clear(): void;
}