diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-10-14 17:35:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 17:35:28 +0200 |
commit | f52bdfadf5198e5df57ae50316a8b9bfe8900b99 (patch) | |
tree | 7ff90a9a44a7d7bbc36c023b2186119b910b6490 /lib | |
parent | 95d45c20580683a7ed332b2e313ee42b8b728bc7 (diff) | |
parent | c9703827e048a733306d5b7a4fadbe51c23d23a0 (diff) | |
download | nextcloud-server-f52bdfadf5198e5df57ae50316a8b9bfe8900b99.tar.gz nextcloud-server-f52bdfadf5198e5df57ae50316a8b9bfe8900b99.zip |
Merge pull request #34188 from nextcloud/feat/profiler-clear
Expose clearing the profiles and fix it
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Profiler/FileProfilerStorage.php | 1 | ||||
-rw-r--r-- | lib/private/Profiler/Profiler.php | 4 | ||||
-rw-r--r-- | lib/public/Profiler/IProfiler.php | 6 |
3 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/Profiler/FileProfilerStorage.php b/lib/private/Profiler/FileProfilerStorage.php index ce09ed51ed9..d583549332e 100644 --- a/lib/private/Profiler/FileProfilerStorage.php +++ b/lib/private/Profiler/FileProfilerStorage.php @@ -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 { diff --git a/lib/private/Profiler/Profiler.php b/lib/private/Profiler/Profiler.php index 8aa800fbc6d..9fd5e76d592 100644 --- a/lib/private/Profiler/Profiler.php +++ b/lib/private/Profiler/Profiler.php @@ -102,4 +102,8 @@ class Profiler implements IProfiler { public function setEnabled(bool $enabled): void { $this->enabled = $enabled; } + + public function clear(): void { + $this->storage->purge(); + } } diff --git a/lib/public/Profiler/IProfiler.php b/lib/public/Profiler/IProfiler.php index 78325089523..5fa4582add7 100644 --- a/lib/public/Profiler/IProfiler.php +++ b/lib/public/Profiler/IProfiler.php @@ -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; } |