Skip to content

Commit

Permalink
Improve logging and add user login time performance tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcolon021 committed May 26, 2024
1 parent 8913d50 commit 9bf9109
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private JsonNode getFENCEUserProfile(String access_token) {
List<Header> headers = new ArrayList<>();
headers.add(new BasicHeader("Authorization", "Bearer " + access_token));

logger.debug("getFENCEUserProfile() getting user profile from uri:"+JAXRSConfiguration.idp_provider_uri+"/user/user");
logger.debug("getFENCEUserProfile() getting user profile from uri:{}/user/user", JAXRSConfiguration.idp_provider_uri);
JsonNode fence_user_profile_response = HttpClientUtil.simpleGet(
JAXRSConfiguration.idp_provider_uri+"/user/user",
JAXRSConfiguration.client,
Expand Down Expand Up @@ -182,6 +182,8 @@ public Response getFENCEProfile(String callback_url, Map<String, String> authReq
"from the Gen3 authentication provider."+ex.getMessage());
}

// Time performance of user login.
long startTime = System.currentTimeMillis();
User current_user = null;
try {
// Create or retrieve the user profile from our database, based on the the key
Expand Down Expand Up @@ -235,6 +237,8 @@ public Response getFENCEProfile(String callback_url, Map<String, String> authReq
logger.info("LOGIN SUCCESS ___ " + current_user.getEmail() + ":" + current_user.getUuid().toString() + ":" + current_user.getSubject() + " ___ Authorization will expire at ___ " + responseMap.get("expirationDate") + "___");
logger.debug("getFENCEProfile() UserProfile response object has been generated");
logger.debug("getFENCEToken() finished");

System.out.println("User login took: " + (System.currentTimeMillis() - startTime) + "ms");
return PICSUREResponse.success(responseMap);
}

Expand Down

0 comments on commit 9bf9109

Please sign in to comment.