@Test public void testGetData() { }
public List<Map<String, Object>> getData(ReportRequest reportRequest, ReportDefinition reportDefinition,String authToken) { Long userId = reportRequest.getRequestInfo().getUserInfo() == null ? null : reportRequest.getRequestInfo().getUserInfo().getId(); String query = reportQueryBuilder.buildQuery(reportRequest.getSearchParams(),reportRequest.getTenantId(),reportDefinition,authToken, userId); Long startTime = new Date().getTime(); List<Map<String, Object>> maps = null; LOGGER.info("final query:"+query); try { maps = jdbcTemplate.queryForList(query); } catch(Exception e){ LOGGER.info("Query Execution Failed: ",e); throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR.toString(), e.getMessage()); } Long endTime = new Date().getTime(); Long totalExecutionTime = endTime-startTime; LOGGER.info("total query execution time taken in millisecount:"+totalExecutionTime); if(endTime-startTime>maxExecutionTime) LOGGER.error("Sql query is taking time query:"+query); return maps; }
ReportRepository { public List<Map<String, Object>> getData(ReportRequest reportRequest, ReportDefinition reportDefinition,String authToken) { Long userId = reportRequest.getRequestInfo().getUserInfo() == null ? null : reportRequest.getRequestInfo().getUserInfo().getId(); String query = reportQueryBuilder.buildQuery(reportRequest.getSearchParams(),reportRequest.getTenantId(),reportDefinition,authToken, userId); Long startTime = new Date().getTime(); List<Map<String, Object>> maps = null; LOGGER.info("final query:"+query); try { maps = jdbcTemplate.queryForList(query); } catch(Exception e){ LOGGER.info("Query Execution Failed: ",e); throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR.toString(), e.getMessage()); } Long endTime = new Date().getTime(); Long totalExecutionTime = endTime-startTime; LOGGER.info("total query execution time taken in millisecount:"+totalExecutionTime); if(endTime-startTime>maxExecutionTime) LOGGER.error("Sql query is taking time query:"+query); return maps; } }
ReportRepository { public List<Map<String, Object>> getData(ReportRequest reportRequest, ReportDefinition reportDefinition,String authToken) { Long userId = reportRequest.getRequestInfo().getUserInfo() == null ? null : reportRequest.getRequestInfo().getUserInfo().getId(); String query = reportQueryBuilder.buildQuery(reportRequest.getSearchParams(),reportRequest.getTenantId(),reportDefinition,authToken, userId); Long startTime = new Date().getTime(); List<Map<String, Object>> maps = null; LOGGER.info("final query:"+query); try { maps = jdbcTemplate.queryForList(query); } catch(Exception e){ LOGGER.info("Query Execution Failed: ",e); throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR.toString(), e.getMessage()); } Long endTime = new Date().getTime(); Long totalExecutionTime = endTime-startTime; LOGGER.info("total query execution time taken in millisecount:"+totalExecutionTime); if(endTime-startTime>maxExecutionTime) LOGGER.error("Sql query is taking time query:"+query); return maps; }  }
ReportRepository { public List<Map<String, Object>> getData(ReportRequest reportRequest, ReportDefinition reportDefinition,String authToken) { Long userId = reportRequest.getRequestInfo().getUserInfo() == null ? null : reportRequest.getRequestInfo().getUserInfo().getId(); String query = reportQueryBuilder.buildQuery(reportRequest.getSearchParams(),reportRequest.getTenantId(),reportDefinition,authToken, userId); Long startTime = new Date().getTime(); List<Map<String, Object>> maps = null; LOGGER.info("final query:"+query); try { maps = jdbcTemplate.queryForList(query); } catch(Exception e){ LOGGER.info("Query Execution Failed: ",e); throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR.toString(), e.getMessage()); } Long endTime = new Date().getTime(); Long totalExecutionTime = endTime-startTime; LOGGER.info("total query execution time taken in millisecount:"+totalExecutionTime); if(endTime-startTime>maxExecutionTime) LOGGER.error("Sql query is taking time query:"+query); return maps; }  List<Map<String, Object>> getData(ReportRequest reportRequest, ReportDefinition reportDefinition,String authToken); }
ReportRepository { public List<Map<String, Object>> getData(ReportRequest reportRequest, ReportDefinition reportDefinition,String authToken) { Long userId = reportRequest.getRequestInfo().getUserInfo() == null ? null : reportRequest.getRequestInfo().getUserInfo().getId(); String query = reportQueryBuilder.buildQuery(reportRequest.getSearchParams(),reportRequest.getTenantId(),reportDefinition,authToken, userId); Long startTime = new Date().getTime(); List<Map<String, Object>> maps = null; LOGGER.info("final query:"+query); try { maps = jdbcTemplate.queryForList(query); } catch(Exception e){ LOGGER.info("Query Execution Failed: ",e); throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR.toString(), e.getMessage()); } Long endTime = new Date().getTime(); Long totalExecutionTime = endTime-startTime; LOGGER.info("total query execution time taken in millisecount:"+totalExecutionTime); if(endTime-startTime>maxExecutionTime) LOGGER.error("Sql query is taking time query:"+query); return maps; }  List<Map<String, Object>> getData(ReportRequest reportRequest, ReportDefinition reportDefinition,String authToken); static final Logger LOGGER; }