Skip to content

Commit

Permalink
add option to clear saved profiles
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed May 23, 2022
1 parent 8d599c3 commit 641665e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Profiler/FileProfilerStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,8 @@ protected function createProfileFromData(string $token, array $data, IProfile $p

return $profile;
}

public function clear(): void {
\OC_Helper::rmdirr($this->folder, false);
}
}
4 changes: 4 additions & 0 deletions lib/private/Profiler/Profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@ public function isEnabled(): bool {
public function setEnabled(bool $enabled): void {
$this->enabled = $enabled;
}

public function clear(): void {
$this->storage->clear();
}
}
6 changes: 6 additions & 0 deletions lib/public/Profiler/IProfiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,10 @@ public function setEnabled(bool $enabled): void;
* @since 24.0.0
*/
public function collect(Request $request, Response $response): IProfile;

/**
* Remove all stored profiles
* @since 25.0.0
*/
public function clear(): void;
}

0 comments on commit 641665e

Please sign in to comment.