Commit 46207e97 authored by Brian Major's avatar Brian Major
Browse files

ac2 - added more profiling

parent 0a486bbe
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -542,6 +542,7 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO
        throws UserNotFoundException, TransientException
    {
        String searchField = userLdapAttrib.get(userID.getClass());
        profiler.checkpoint("getAugmentedUser.getSearchField");
        if (searchField == null)
        {
            throw new IllegalArgumentException(
@@ -586,6 +587,10 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO
            LdapDAO.checkLdapResult(e.getResultCode());
            throw new RuntimeException("BUG: checkLdapResult didn't throw an exception");
        }
        finally
        {
            profiler.checkpoint("Done getAugmentedUser");
        }
    }

    /**
+7 −1
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ import ca.nrc.cadc.ac.UserNotFoundException;
import ca.nrc.cadc.ac.UserRequest;
import ca.nrc.cadc.ac.server.UserPersistence;
import ca.nrc.cadc.net.TransientException;
import ca.nrc.cadc.profiler.Profiler;

import com.unboundid.ldap.sdk.DN;
import org.apache.log4j.Logger;

@@ -85,6 +87,7 @@ public class LdapUserPersistence<T extends Principal> implements UserPersistenc
{
    private static final Logger logger = Logger.getLogger(LdapUserPersistence.class);
    private LdapConfig config;
    private Profiler profiler = new Profiler(LdapUserPersistence.class);

    public LdapUserPersistence()
    {
@@ -230,7 +233,10 @@ public class LdapUserPersistence<T extends Principal> implements UserPersistenc
        try
        {
            userDAO = new LdapUserDAO<T>(this.config);
            return userDAO.getAugmentedUser(userID);
            profiler.checkpoint("Create LdapUserDAO");
            User<T> user = userDAO.getAugmentedUser(userID);
            profiler.checkpoint("getAugmentedUser");
            return user;
        }
        finally
        {
+1 −3
Original line number Diff line number Diff line
@@ -97,8 +97,6 @@ public class UserServlet extends HttpServlet
    private static final long serialVersionUID = 5289130885807305288L;
    private static final Logger log = Logger.getLogger(UserServlet.class);

    private Profiler profiler = new Profiler(UserServlet.class);

    private String notAugmentedX500User;

    @Override
@@ -123,7 +121,7 @@ public class UserServlet extends HttpServlet
    private void doAction(UserActionFactory factory, HttpServletRequest request, HttpServletResponse response)
        throws IOException
    {
        profiler.checkpoint("startNewRequest");
        Profiler profiler = new Profiler(UserServlet.class);
        long start = System.currentTimeMillis();
        UserLogInfo logInfo = new UserLogInfo(request);