Skip to content

Commit 9bf9109

Browse files
committed
Improve logging and add user login time performance tracking
1 parent 8913d50 commit 9bf9109

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/auth/FENCEAuthenticationService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private JsonNode getFENCEUserProfile(String access_token) {
102102
List<Header> headers = new ArrayList<>();
103103
headers.add(new BasicHeader("Authorization", "Bearer " + access_token));
104104

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

185+
// Time performance of user login.
186+
long startTime = System.currentTimeMillis();
185187
User current_user = null;
186188
try {
187189
// Create or retrieve the user profile from our database, based on the the key
@@ -235,6 +237,8 @@ public Response getFENCEProfile(String callback_url, Map<String, String> authReq
235237
logger.info("LOGIN SUCCESS ___ " + current_user.getEmail() + ":" + current_user.getUuid().toString() + ":" + current_user.getSubject() + " ___ Authorization will expire at ___ " + responseMap.get("expirationDate") + "___");
236238
logger.debug("getFENCEProfile() UserProfile response object has been generated");
237239
logger.debug("getFENCEToken() finished");
240+
241+
System.out.println("User login took: " + (System.currentTimeMillis() - startTime) + "ms");
238242
return PICSUREResponse.success(responseMap);
239243
}
240244

0 commit comments

Comments
 (0)