Package com.jamonapi

Examples of com.jamonapi.Monitor


   * @see com.jamonapi.MonitorFactory#start
   * @see com.jamonapi.Monitor#stop
   */
  protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
    String name = createInvocationTraceName(invocation);
    Monitor monitor = MonitorFactory.start(name);
    try {
      return invocation.proceed();
    }
    finally {
      monitor.stop();
      if (!this.trackAllInvocations || isLogEnabled(logger)) {
        logger.trace("JAMon performance statistics for method [" + name + "]:\n" + monitor);
      }
    }
  }
View Full Code Here


    // This is a test to make sure commit time stays the same as time goes on.
    @Test
    @Ignore("OAK-461")
    public void commitTime() throws Exception {
        boolean debug = false;
        Monitor commitMonitor = MonitorFactory.getTimeMonitor("commit");
        for (int i = 0; i < 1000; i++) {
            commitMonitor.start();
            String diff = "+\"a"+i+"\" : {} +\"b"+i+"\" : {} +\"c"+i+"\" : {}";
            if (debug) {
                System.out.println("Committing: " + diff);
            }
            mk.commit("/", diff, null, null);
            commitMonitor.stop();
            if (debug) {
                System.out.println("Committed in " + commitMonitor.getLastValue() + "ms");
            }
        }
        if (debug) {
            System.out.println("Final Result:" + commitMonitor);
        }
View Full Code Here

   * @see com.jamonapi.Monitor#stop
   */
  @Override
  protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
    String name = createInvocationTraceName(invocation);
    Monitor monitor = MonitorFactory.start(name);
    try {
      return invocation.proceed();
    }
    finally {
      monitor.stop();
      if (!this.trackAllInvocations || isLogEnabled(logger)) {
        logger.trace("JAMon performance statistics for method [" + name + "]:\n" + monitor);
      }
    }
  }
View Full Code Here

*
* @return true, if checks if is authorized
*/
    public boolean isAuthorized(String token,String userId, String idFolder, String state) {
        logger.debug("IN");
        Monitor monitor =MonitorFactory.start("spagobi.service.security.isAuthorized");
  try {
          validateTicket(token, userId);
    SpagoBIUserProfile profile= supplier.createUserProfile(userId);
    profile.setFunctions(UserUtilities.readFunctionality(profile.getRoles()));
    UserProfile userProfile=new UserProfile(profile);     
    return ObjectsAccessVerifier.canExec(new Integer(idFolder), userProfile);
  } catch (SecurityException e) {
      logger.error("SecurityException", e);
      return false;
  } finally {
      monitor.stop();     
      logger.debug("OUT");
 


    }
View Full Code Here

     *
     * @return true, if check authorization
     */
    public boolean checkAuthorization(String token,String userId,String function) {
        logger.debug("IN");
        Monitor monitor =MonitorFactory.start("spagobi.service.security.checkAuthorization")
  try {
      validateTicket(token,userId);
            return supplier.checkAuthorization(userId,function);
  } catch (SecurityException e) {
      logger.error("SecurityException",e);
      return false;
  }finally{
      monitor.stop();     
      logger.debug("OUT");
  }
 
    }
View Full Code Here

      super();
    }
   
    public SpagobiAnalyticalDriver[] getDocumentAnalyticalDrivers(String token, String user, Integer id, String language, String country){
      logger.debug("IN");
      Monitor monitor = MonitorFactory.start("spagobi.service.sbidocument.getDocumentParameters");
      try {
          validateTicket(token, user);
          return supplier.getDocumentAnalyticalDrivers(id, language, country);
      } catch (SecurityException e) {
          logger.error("SecurityException", e);
          return null;
      } finally {
          monitor.stop();
          logger.debug("OUT");
     
    }
View Full Code Here

     
    }
   
    public String getDocumentAnalyticalDriversJSON(String token, String user, Integer id, String language, String country){
      logger.debug("IN");
      Monitor monitor = MonitorFactory.start("spagobi.service.sbidocument.getDocumentParametersJSON");
      try {
          validateTicket(token, user);
          return supplier.getDocumentAnalyticalDriversJSON(id, language, country);
      } catch (SecurityException e) {
          logger.error("SecurityException", e);
          return null;
      } finally {
          monitor.stop();
          logger.debug("OUT");
     
    }
View Full Code Here

     *
     * @return String
     */
    public String log(String token,String user,String id,String start,String end,String state,String message,String errorCode){
  logger.debug("IN");
  Monitor monitor =MonitorFactory.start("spagobi.service.audit.log");
  try {
      validateTicket(token, user);
      return log( user, id, start, end, state, message, errorCode);
  } catch (SecurityException e) {
      logger.error("SecurityException", e);
      return null;
  } finally {
      monitor.stop();
      logger.debug("OUT");
 

    }
View Full Code Here

   *
   * @return the job list
   */
  public String getJobList(String token,String user){
    logger.debug("IN");
    Monitor monitor =MonitorFactory.start("spagobi.service.scheduler.getJobList");
    try {
        validateTicket(token, user);
        return supplier.getJobList();
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        monitor.stop();
        logger.debug("OUT");
    }   
   
  }
View Full Code Here

   *
   * @return the job schedulation list
   */
  public String getJobSchedulationList(String token,String user,String jobName, String jobGroup){
    logger.debug("IN");
    Monitor monitor =MonitorFactory.start("spagobi.service.scheduler.getJobSchedulationList");
    try {
        validateTicket(token, user);
        return supplier.getJobSchedulationList(jobName,jobGroup);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        monitor.stop();
        logger.debug("OUT");
    }   
     
  }
View Full Code Here

TOP

Related Classes of com.jamonapi.Monitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.