Add method timings with conditional logging

- Add timing measurements to key methods
- Only log when duration exceeds 1 second
This commit is contained in:
pascal
2025-11-03 11:52:44 +01:00
parent a2313a5ba4
commit 9eb2faef7f
4 changed files with 25 additions and 0 deletions

View File

@@ -575,6 +575,8 @@ func (s *SqlStore) GetUserByPATID(ctx context.Context, lockStrength LockingStren
}
func (s *SqlStore) GetUserByUserID(ctx context.Context, lockStrength LockingStrength, userID string) (*types.User, error) {
defer util.TimeTrack(ctx, "GetUserByUserID")()
ctx, cancel := getDebuggingCtx(ctx)
defer cancel()
@@ -1127,6 +1129,8 @@ func (s *SqlStore) GetAccountCreatedBy(ctx context.Context, lockStrength Locking
// SaveUserLastLogin stores the last login time for a user in DB.
func (s *SqlStore) SaveUserLastLogin(ctx context.Context, accountID, userID string, lastLogin time.Time) error {
defer util.TimeTrack(ctx, "SyncUserJWTGroups")()
ctx, cancel := getDebuggingCtx(ctx)
defer cancel()