@Test
  public void testMetrics() throws Exception {
    InMemoryRichGaugeRepository repository = new InMemoryRichGaugeRepository();

    repository.set(new Metric<Double>("a", 0.d, new Date()));
    repository.set(new Metric<Double>("a", 0.5d, new Date()));

    RichGaugeReaderPublicMetrics metrics = new RichGaugeReaderPublicMetrics(repository);

    Map<String, Metric<?>> results = new HashMap<String, Metric<?>>();
    for (Metric<?> metric : metrics.metrics()) {
      results.put(metric.getName(), metric);
    }
    assertThat(results.containsKey("a.val")).isTrue();
    assertThat(results.get("a.val").getValue().doubleValue()).isEqualTo(0.5d);

    assertThat(results.containsKey("a.avg")).isTrue();
    assertThat(results.get("a.avg").getValue().doubleValue()).isEqualTo(0.25d);

    assertThat(results.containsKey("a.min")).isTrue();
    assertThat(results.get("a.min").getValue().doubleValue()).isEqualTo(0.0d);

    assertThat(results.containsKey("a.max")).isTrue();
    assertThat(results.get("a.max").getValue().doubleValue()).isEqualTo(0.5d);

    assertThat(results.containsKey("a.count")).isTrue();
    assertThat(results.get("a.count").getValue().longValue()).isEqualTo(2L);

    assertThat(results.containsKey("a.alpha")).isTrue();
    assertThat(results.get("a.alpha").getValue().doubleValue()).isEqualTo(-1.d);
  }
 public String incrementUricounter(String className, String methodName) {
   counterService.increment(className + "." + methodName);
   Metric metric = repository.findOne("gauge." + className + "." + methodName + "");
   if (metric != null) {
     gaugeservice.submit(className + "." + methodName, (Double) metric.getValue() + 1);
   } else {
     gaugeservice.submit(className + "." + methodName, 1);
   }
   return className + "." + methodName;
 }
 @Test
 public void prefixWithPeriod() {
   this.repository.increment(new Delta<Number>("foo.bar", 1));
   Set<String> names = new HashSet<String>();
   for (Metric<?> metric : this.repository.findAll("foo.")) {
     names.add(metric.getName());
   }
   assertThat(names).hasSize(1);
   assertThat(names.contains("foo.bar")).isTrue();
 }
 private Delta<?> calculateDelta(Metric<?> value) {
   long delta = value.getValue().longValue();
   Long old = this.counts.replace(value.getName(), delta);
   if (old != null) {
     delta = delta - old;
   } else {
     this.counts.putIfAbsent(value.getName(), delta);
   }
   return new Delta<Long>(value.getName(), delta, value.getTimestamp());
 }
 @Override
 protected void write(String group, Collection<Metric<?>> values) {
   for (Metric<?> value : values) {
     if (value.getName().startsWith("counter.") && this.counter != null) {
       this.counter.increment(calculateDelta(value));
     } else {
       this.writer.set(value);
     }
   }
 }
 @Test
 public void onlyRegisteredPrefixCounted() {
   this.repository.increment(new Delta<Number>("foo.bar", 1));
   this.repository.increment(new Delta<Number>("foobar.spam", 1));
   Set<String> names = new HashSet<String>();
   for (Metric<?> metric : this.repository.findAll("foo")) {
     names.add(metric.getName());
   }
   assertThat(names).hasSize(1);
   assertThat(names.contains("foo.bar")).isTrue();
 }
 @Test
 public void testMetrics() throws Exception {
   InMemoryMetricRepository repository = new InMemoryMetricRepository();
   repository.set(new Metric<Double>("a", 0.5, new Date()));
   VanillaPublicMetrics publicMetrics = new VanillaPublicMetrics(repository);
   Map<String, Metric<?>> results = new HashMap<String, Metric<?>>();
   for (Metric<?> metric : publicMetrics.metrics()) {
     results.put(metric.getName(), metric);
   }
   assertThat(results.get("a").getValue().doubleValue(), equalTo(0.5));
 }
 @Test
 public void incrementGroup() {
   this.repository.increment("foo", new Delta<Number>("foo.bar", 1));
   this.repository.increment("foo", new Delta<Number>("foo.bar", 2));
   this.repository.increment("foo", new Delta<Number>("foo.spam", 1));
   Set<String> names = new HashSet<String>();
   for (Metric<?> metric : this.repository.findAll("foo")) {
     names.add(metric.getName());
   }
   assertThat(names).hasSize(2);
   assertThat(names.contains("foo.bar")).isTrue();
   assertThat(this.repository.findOne("foo.bar").getValue()).isEqualTo(3L);
 }
 @Override
 public void set(String group, Collection<Metric<?>> values) {
   String prefix = group;
   if (!prefix.endsWith(".")) {
     prefix = prefix + ".";
   }
   for (Metric<?> metric : values) {
     if (!metric.getName().startsWith(prefix)) {
       metric =
           new Metric<Number>(prefix + metric.getName(), metric.getValue(), metric.getTimestamp());
     }
     set(metric);
   }
   this.groups.add(group);
 }
  @Test
  public void testAdditionalMetrics() throws Exception {
    InMemoryMetricRepository repository = new InMemoryMetricRepository();
    Collection<PublicMetrics> allMetrics = new ArrayList<PublicMetrics>();
    allMetrics.add(new ImmutablePublicMetrics(new Metric<Number>("first", 2L)));
    allMetrics.add(new ImmutablePublicMetrics(new Metric<Number>("second", 4L)));

    VanillaPublicMetrics publicMetrics = new VanillaPublicMetrics(repository, allMetrics);
    Map<String, Metric<?>> results = new HashMap<String, Metric<?>>();
    for (Metric<?> metric : publicMetrics.metrics()) {
      results.put(metric.getName(), metric);
    }
    assertTrue(results.containsKey("first"));
    assertTrue(results.containsKey("second"));
    assertEquals(2, results.size());
  }
 private boolean isMatch(Metric<?> metric) {
   String[] includes = MetricCopyExporter.this.includes;
   String[] excludes = MetricCopyExporter.this.excludes;
   String name = metric.getName();
   if (ObjectUtils.isEmpty(includes) || PatternMatchUtils.simpleMatch(includes, name)) {
     return !PatternMatchUtils.simpleMatch(excludes, name);
   }
   return false;
 }
 @Around(value = "allOperation()||athenaServiceOperation()||spartanServiceOperation()")
 @Order(1)
 public Object aroundAdvice1(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
   System.out.println(
       "In aroundAdvice Order 1 : Calling method : "
           + proceedingJoinPoint.getSignature().getName());
   HttpServletRequest request =
       ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
   ServletWebRequest servletWebRequest = new ServletWebRequest(request);
   HttpServletResponse response = servletWebRequest.getResponse();
   HttpSession session = request.getSession();
   long nextAutoNum = autoRequestId.getAndIncrement();
   methodCallStack.setRequestId(UUID.randomUUID().toString().toUpperCase());
   MethodCallDetails methodCallDetails =
       new MethodCallDetails(
           methodCallStack.getRequestId(),
           HealthConstants.CLASS_TYPE.SERVICE,
           request.getRemoteHost(),
           request.getMethod(),
           proceedingJoinPoint.getTarget().getClass().toString(),
           proceedingJoinPoint.getSignature().getName(),
           loggedInUserId(request),
           getSessionId(request));
   String entityName =
       incrementUricounter(
           proceedingJoinPoint.getSignature().getDeclaringType().getSimpleName(),
           proceedingJoinPoint.getSignature().getName());
   ResponseEntity<ResponseBean> responseEntity = new ResponseEntity<>(HttpStatus.OK);
   /*
    * Needs to get user id from request header and pass it to entityAudit
    * and RuntimeLogInfo
    */
   /* create logging info object (Needs to call from login service only */
   runtimeLogInfoHelper.setCustomerId(getCustomerId(request));
   runtimeLogInfoHelper.createRuntimeLogUserInfo(
       1, loggedInUserId(request), request.getRemoteHost());
   /* validate request */
   try {
     if (request.getHeader("Job-Execution") == null) {
       if (request.getHeader("isBeforeSession") == null) {
         validateRequest(session, request, response);
         if (!sessionValidation.checkIgnoreURL(request)) {
           /** Sets user's last access time in table */
           java.sql.Timestamp currentTime = new java.sql.Timestamp(System.currentTimeMillis());
           loginSessionRepo.updateLastAccessTime(
               loggedInUserId(request), session.getAttribute("usidHash").toString(), currentTime);
           runtimeLogInfoHelper.setUserAccessCode(
               Integer.parseInt(session.getAttribute("userAccessCode").toString()));
         }
       }
     }
     Object obj = proceedingJoinPoint.proceed();
     responseEntity = (ResponseEntity<ResponseBean>) obj;
     httpStatusCode = responseEntity.getStatusCode();
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_NORMAL_EXECUTION, responseEntity.getStatusCode().name());
   } catch (SpartanAccessDeniedException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         4005,
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(
             sprinkler,
             runtimeLogInfoHelper.getRuntimeLogInfo(),
             " Access Denied " + e.getMessage());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (SpartanPersistenceException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(
             sprinkler,
             runtimeLogInfoHelper.getRuntimeLogInfo(),
             " Can not perform Operation on entity:" + e.getMessage());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (SpartanTransactionException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(
             sprinkler, runtimeLogInfoHelper.getRuntimeLogInfo(), e.getMessage());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (SpartanDataNotFoundException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(sprinkler, runtimeLogInfoHelper.getRuntimeLogInfo());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (com.athena.framework.server.exception.biz.SpartanBusinessValidationFailedException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(sprinkler, runtimeLogInfoHelper.getRuntimeLogInfo());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (Exception e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         4005,
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean responseBean = new ResponseBean();
     responseBean.add("success", false);
     responseBean.add("message", " Access Denied:" + e.getMessage());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         HealthConstants.DEFAULT_EXCEPTION_ID,
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(responseBean, responseEntity.getStatusCode());
   } finally {
     /** Sets user's last access time in table */
     /*if (request.getHeader("Job-Execution") == null) {
     if (request.getHeader("isBeforeSession") == null) {
     java.sql.Timestamp currentTime = new java.sql.Timestamp(System.currentTimeMillis());
     loginSessionRepo.updateLastAccessTime(loggedInUserId(request), session.getAttribute("usidHash").toString(), currentTime);
     }
     }*/
     methodCallStack.addServiceMethodCallDetails(methodCallDetails);
     healthmeter.apphealth.writeHealthLog((ArtMethodCallStack) methodCallStack.clone());
     Integer existingValue = 0;
     Metric metric = repository.findOne("gauge." + "total.Time " + entityName + "");
     if (metric != null) {
       existingValue = metric.getValue().intValue();
     }
     gaugeservice.submit(
         "total.Time " + entityName + "", executionTimer.getSystemTime + existingValue);
   }
   return responseEntity;
 }
 @Around("allOperation()")
 @Order(1)
 public Object aroundAdvice1(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
   HttpServletRequest request =
       ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
   ServletWebRequest servletWebRequest = new ServletWebRequest(request);
   HttpServletResponse response = servletWebRequest.getResponse();
   HttpSession session = request.getSession();
   long nextAutoNum = autoRequestId.getAndIncrement();
   methodCallStack.setRequestId(UUID.randomUUID().toString().toUpperCase());
   methodCallStack.setAppSessionId(getSessionId(request));
   MethodCallDetails methodCallDetails =
       new MethodCallDetails(
           methodCallStack.getRequestId(),
           methodCallStack.getCallSequence(),
           HealthConstants.CLASS_TYPE.SERVICE,
           request.getRemoteHost(),
           request.getMethod(),
           proceedingJoinPoint.getTarget().getClass().toString(),
           proceedingJoinPoint.getSignature().getName(),
           loggedInUserId(request),
           getSessionId(request));
   String entityName =
       incrementUricounter(
           proceedingJoinPoint.getSignature().getDeclaringType().getSimpleName(),
           proceedingJoinPoint.getSignature().getName());
   ResponseEntity<ResponseBean> responseEntity = new ResponseEntity<>(HttpStatus.OK);
   try {
     serviceLogic(session, request, response);
     Object obj = proceedingJoinPoint.proceed();
     responseEntity = (ResponseEntity<ResponseBean>) obj;
     httpStatusCode = responseEntity.getStatusCode();
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_NORMAL_EXECUTION, responseEntity.getStatusCode().name());
   } catch (SpartanAccessDeniedException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         4005,
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(
             sprinkler,
             runtimeLogInfoHelper.getRuntimeLogInfo(),
             "Access Denied" + e.getMessage());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (SpartanPersistenceException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(
             sprinkler,
             runtimeLogInfoHelper.getRuntimeLogInfo(),
             "Can not perform Operation on entity:" + e.getMessage());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (SpartanTransactionException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(sprinkler, runtimeLogInfoHelper.getRuntimeLogInfo());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (SpartanDataNotFoundException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(sprinkler, runtimeLogInfoHelper.getRuntimeLogInfo());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (com.athena.framework.server.exception.biz.SpartanBusinessValidationFailedException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(sprinkler, runtimeLogInfoHelper.getRuntimeLogInfo());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (com.athena.framework.server.exception.biz.SpartanConstraintViolationException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(sprinkler, runtimeLogInfoHelper.getRuntimeLogInfo());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         e.getExceptionId(),
         responseEntity.getStatusCode().name());
     httpStatusCode = HttpStatus.PRECONDITION_FAILED;
     return new ResponseEntity<ResponseBean>(exceptionbean, responseEntity.getStatusCode());
   } catch (Exception e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         4005,
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean responseBean = new ResponseBean();
     responseBean.add("success", false);
     responseBean.add("message", "Access Denied:" + e.getMessage());
     methodCallDetails.setPostCallDetails(
         HealthConstants.METHOD_EXCEPTION,
         HealthConstants.DEFAULT_EXCEPTION_ID,
         responseEntity.getStatusCode().name());
     return new ResponseEntity<ResponseBean>(responseBean, responseEntity.getStatusCode());
   } finally {
     methodCallStack.addMethodCallDetails(methodCallDetails);
     healthmeter.apphealth.writeHealthLog((ArtMethodCallStack) methodCallStack.clone());
     Integer existingValue = 0;
     Metric metric = repository.findOne("gauge." + "total.Time" + entityName + "");
     if (metric != null) {
       existingValue = metric.getValue().intValue();
     }
     gaugeservice.submit(
         "total.Time" + entityName + "", executionTimer.getSystemTime + existingValue);
   }
   return responseEntity;
 }
 @Override
 public void set(Metric<?> value) {
   this.metrics.set(value.getName(), value);
 }
Example #15
0
 @Around(value = "allOperation()||athenaServiceOperation()||spartanServiceOperation()")
 @Order(1)
 public Object aroundAdvice1(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
   System.out.println(
       "In aroundAdvice Order 1 : Calling method : "
           + proceedingJoinPoint.getSignature().getName());
   HttpServletRequest request =
       ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
   HttpSession session = request.getSession();
   long nextAutoNum = autoRequestId.getAndIncrement();
   methodCallStack.setRequestId(UUID.randomUUID().toString().toUpperCase());
   MethodCallDetails methodCallDetails =
       new MethodCallDetails(
           methodCallStack.getRequestId(),
           HealthConstants.CLASS_TYPE.SERVICE,
           request.getRemoteHost(),
           request.getMethod(),
           proceedingJoinPoint.getTarget().getClass().toString(),
           proceedingJoinPoint.getSignature().getName(),
           "",
           getSessionId(request));
   String entityName =
       incrementUricounter(
           proceedingJoinPoint.getSignature().getDeclaringType().getSimpleName(),
           proceedingJoinPoint.getSignature().getName());
   // ResponseEntity<ResponseBean> responseEntity = new
   // ResponseEntity<>(HttpStatus.OK);
   Object responseEntity = null;
   /*
    * Needs to get user id from request header and pass it to entityAudit
    * and RuntimeLogInfo
    */
   /* create logging info object (Needs to call from login service only */
   runtimeLogInfoHelper.createRuntimeLogUserInfo(1, "", request.getRemoteHost());
   /* validate request */
   try {
     // validateRequest(session, request);
     // if (!sessionValidation.checkIgnoreURL(request)) {
     // runtimeLogInfoHelper.setUserAccessCode(Integer.parseInt(session.getAttribute("userAccessCode").toString()));
     // }
     Object obj = proceedingJoinPoint.proceed();
     // comment by maya
     /*
      * if (obj instanceof ResponseEntity<?>) { responseEntity =
      * (ResponseEntity<ResponseBean>) obj; httpStatusCode =
      * responseEntity.getStatusCode(); } else { httpStatusCode =
      * HttpStatus.OK; return obj; }
      */
     responseEntity = obj;
     // responseEntity = (ResponseEntity<ResponseBean>) obj;
     // httpStatusCode = responseEntity.getStatusCode();
     // methodCallDetails.setPostCallDetails(HealthConstants.METHOD_NORMAL_EXECUTION,
     // responseEntity.getStatusCode().name());
   } catch (SpartanAccessDeniedException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         4005,
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(
             sprinkler,
             runtimeLogInfoHelper.getRuntimeLogInfo(),
             " Access Denied " + e.getMessage());
     // methodCallDetails.setPostCallDetails(HealthConstants.METHOD_EXCEPTION,
     // e.getExceptionId(), responseEntity.getStatusCode().name());
     // return new ResponseEntity<ResponseBean>(exceptionbean,
     // responseEntity.getStatusCode());
   } catch (SpartanPersistenceException e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         e.getExceptionId(),
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean exceptionbean =
         e.prepareExceptionBean(
             sprinkler,
             runtimeLogInfoHelper.getRuntimeLogInfo(),
             " Can not perform Operation on entity:" + e.getMessage());
     // methodCallDetails.setPostCallDetails(HealthConstants.METHOD_EXCEPTION,
     // e.getExceptionId(), responseEntity.getStatusCode().name());
     // return new ResponseEntity<ResponseBean>(exceptionbean,
     // responseEntity.getStatusCode());
   } catch (Exception e) {
     sprinkler.logger.log(
         runtimeLogInfoHelper.getRuntimeLogInfo(),
         4005,
         proceedingJoinPoint.getSignature().getDeclaringTypeName(),
         proceedingJoinPoint.getSignature().getName(),
         request.getRemoteHost(),
         e);
     ResponseBean responseBean = new ResponseBean();
     responseBean.add("success", false);
     responseBean.add("message", " Access Denied:" + e.getMessage());
     // methodCallDetails.setPostCallDetails(HealthConstants.METHOD_EXCEPTION,
     // HealthConstants.DEFAULT_EXCEPTION_ID,
     // responseEntity.getStatusCode().name());
     // return new ResponseEntity<ResponseBean>(responseBean,
     // responseEntity.getStatusCode());
   } finally {
     // httpStatusCode = responseEntity.getStatusCode();
     // requestDetails.postRequestValue(httpStatusCode.name());
     methodCallStack.addServiceMethodCallDetails(methodCallDetails);
     healthmeter.apphealth.writeHealthLog((ArtMethodCallStack) methodCallStack.clone());
     Integer existingValue = 0;
     Metric metric = repository.findOne("gauge." + "total.Time " + entityName + "");
     if (metric != null) {
       existingValue = metric.getValue().intValue();
     }
     gaugeservice.submit(
         "total.Time " + entityName + "", executionTimer.getSystemTime + existingValue);
   }
   return responseEntity;
 }