springboot应用程序需要很长时间来处理GET请求。 DispatcherServlet.ProcessHandlerException()中花费的时间

时间:2019-04-22 17:34:59

标签: spring spring-boot servlets newrelic

我有一个身份验证服务和一些控制器方法,用于基于id,用户名等获取用户详细信息。所有这些HTTP.GET方法花费很长时间进行处理,而新的遗留监控显示DispatcherServlet.ProcessHandlerException()占用了约70个% 的时间。 我正在使用4.2.1.RELEASE版本的Spring。任何帮助将不胜感激。

@ApiOperation(value = "Get User Details From Id",
            notes = "Get the UserDetails object that describes the user", tags = {"/user"})
    @ApiImplicitParams({@ApiImplicitParam(dataType = "String", name = "Authorization", paramType = "header")})
    @GetMapping(value = "/users/realm/{realm}/user/{userName}", produces = Versions.V1_0)
    @Log(level = Log.Level.TRACE)
    public UserDetails getUserDetailsFromUserId(
            @ApiParam(value = "The user's details", required = true) @PathVariable(name = "realm") String realm,
            @ApiParam(value = "Include profiles in user's details") @RequestParam(name = "includeProfiles", required = false) Boolean includeProfiles,
            @PathVariable(name = "userName") String userName) {
        LOGGER.traceEntry(userName, realm, includeProfiles);
        com.nextiva.authentication.model.UserDetails result = userManagementService.getUserDetails(userName, realm, includeProfiles);
        if (includeProfiles != null && includeProfiles) {
            result.setProfiles(result.getProfiles().stream().filter(p -> NumberUtils.isDigits(p.getCorpAcctNbr()) || StringUtils.isBlank(p.getCorpAcctNbr())).collect(Collectors.toList()));
        }
        LOGGER.traceExit();
        return userDetailsConverter.convertFromModelToV1(result);
    }

已附加示例控制器代码。

0 个答案:

没有答案