-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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( | ||||||
'Start of getUserData for {user}', | ||||||
[ | ||||||
'user' => $userId, | ||||||
'ticket' => '66440', | ||||||
] | ||||||
); | ||||||
$currentLoggedInUser = $this->userSession->getUser(); | ||||||
assert($currentLoggedInUser !== null, 'No user logged in'); | ||||||
|
||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'End of getUserData for {user}', | ||||||
[ | ||||||
'user' => $userId, | ||||||
'ticket' => '66440', | ||||||
] | ||||||
); | ||||||
|
||||||
return $data; | ||||||
} | ||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'Start of fillStorageInfo for {user}', | ||||||
[ | ||||||
'user' => $userId, | ||||||
'ticket' => '66440', | ||||||
] | ||||||
); | ||||||
|
||||||
try { | ||||||
\OC_Util::tearDownFS(); | ||||||
\OC_Util::setupFS($userId); | ||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'End of fillStorageInfo for {user}', | ||||||
[ | ||||||
'user' => $userId, | ||||||
'ticket' => '66440', | ||||||
] | ||||||
); | ||||||
|
||||||
return $data; | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -190,6 +190,12 @@ public function getUsers(string $search = '', int $limit = null, int $offset = 0 | |||||
* 200: Users details returned | ||||||
*/ | ||||||
public function getUsersDetails(string $search = '', int $limit = null, int $offset = 0): DataResponse { | ||||||
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( | ||||||
'Start of getUsersDetails', | ||||||
[ | ||||||
'ticket' => '66440', | ||||||
] | ||||||
); | ||||||
$currentUser = $this->userSession->getUser(); | ||||||
$users = []; | ||||||
|
||||||
|
@@ -215,6 +221,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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'Start of getUsersDetails for {user}', | ||||||
[ | ||||||
'user' => $userId, | ||||||
'ticket' => '66440', | ||||||
] | ||||||
); | ||||||
try { | ||||||
$userData = $this->getUserData($userId); | ||||||
} catch (OCSNotFoundException $e) { | ||||||
|
@@ -231,8 +244,20 @@ 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'End of getUsersDetails for {user}', | ||||||
[ | ||||||
'user' => $userId, | ||||||
'ticket' => '66440', | ||||||
] | ||||||
); | ||||||
} | ||||||
|
||||||
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error( | ||||||
'End of getUsersDetails', | ||||||
[ | ||||||
'ticket' => '66440', | ||||||
] | ||||||
); | ||||||
return new DataResponse([ | ||||||
'users' => $usersDetails | ||||||
]); | ||||||
|
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.
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 :)