-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: logging done at the beginning and end of getUsersDetails, getUserData and fillStorageInfo #47660
base: stable28
Are you sure you want to change the base?
fix: logging done at the beginning and end of getUsersDetails, getUserData and fillStorageInfo #47660
Conversation
…rData and fillStorageInfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is app code, it would be cleaner to use the public version instead of the private OC
version :)
But as this is in a controller, maybe just inject the logger once in the constructor?
@@ -110,6 +110,13 @@ public function __construct(string $appName, | |||
* @throws OCSNotFoundException | |||
*/ | |||
protected function getUserData(string $userId, bool $includeScopes = false): ?array { | |||
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( | |
\OCP\Server::get(\Psr\Log\LoggerInterface::class)->error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @susnux, This is a draft pr to help us understand why the user list is slow. Hence not merging the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, it just was set to ´3 to review` so I gave it a quick look :)
@@ -222,6 +229,13 @@ protected function getUserData(string $userId, bool $includeScopes = false): ?ar | |||
'setDisplayName' => $backend instanceof ISetDisplayNameBackend || $backend->implementsActions(Backend::SET_DISPLAYNAME), | |||
'setPassword' => $backend instanceof ISetPasswordBackend || $backend->implementsActions(Backend::SET_PASSWORD), | |||
]; | |||
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( | |
\OCP\Server::get(\Psr\Log\LoggerInterface::class)->error( |
@@ -256,6 +270,14 @@ protected function getUserSubAdminGroupsData(string $userId): array { | |||
* @throws OCSException | |||
*/ | |||
protected function fillStorageInfo(string $userId): array { | |||
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( | |
\OCP\Server::get(\Psr\Log\LoggerInterface::class)->error( |
@@ -294,6 +316,14 @@ protected function fillStorageInfo(string $userId): array { | |||
\OC_Util::tearDownFS(); | |||
return []; | |||
} | |||
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( | |
\OCP\Server::get(\Psr\Log\LoggerInterface::class)->error( |
@@ -215,6 +215,13 @@ public function getUsersDetails(string $search = '', int $limit = null, int $off | |||
$usersDetails = []; | |||
foreach ($users as $userId) { | |||
$userId = (string) $userId; | |||
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( | |
\OCP\Server::get(\Psr\Log\LoggerInterface::class)->error( |
@@ -231,6 +238,13 @@ public function getUsersDetails(string $search = '', int $limit = null, int $off | |||
// only showing its id | |||
$usersDetails[$userId] = ['id' => $userId]; | |||
} | |||
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( | |
\OCP\Server::get(\Psr\Log\LoggerInterface::class)->error( |
…rData and fillStorageInfo
fix: logging done at the beginning and end of getUsersDetails, getUserData and fillStorageInfo
Summary
TODO
Checklist