类 JamonPerformanceMonitorInterceptor

    • 构造器详细资料

      • JamonPerformanceMonitorInterceptor

        public JamonPerformanceMonitorInterceptor​(boolean useDynamicLogger,
                                                  boolean trackAllInvocations)
        Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
        参数:
        useDynamicLogger - whether to use a dynamic logger or a static logger
        trackAllInvocations - whether to track all invocations that go through this interceptor, or just invocations with trace logging enabled
        另请参阅:
        AbstractTraceInterceptor.setUseDynamicLogger(boolean)
    • 方法详细资料

      • setTrackAllInvocations

        public void setTrackAllInvocations​(boolean trackAllInvocations)
        Set whether to track all invocations that go through this interceptor, or just invocations with trace logging enabled.

        Default is "false": Only invocations with trace logging enabled will be monitored. Specify "true" to let JAMon track all invocations, gathering statistics even when trace logging is disabled.

      • invokeUnderTrace

        protected Object invokeUnderTrace​(MethodInvocation invocation,
                                          Log logger)
                                   throws Throwable
        Wraps the invocation with a JAMon Monitor and writes the current performance statistics to the log (if enabled).
        指定者:
        invokeUnderTrace 在类中 AbstractTraceInterceptor
        logger - the Log to write trace messages to
        返回:
        the result of the call to MethodInvocation.proceed()
        抛出:
        Throwable - if the call to MethodInvocation.proceed() encountered any errors
        另请参阅:
        MonitorFactory.start(java.lang.String), Monitor.stop()
      • trackException

        protected void trackException​(com.jamonapi.MonKey key,
                                      Throwable ex)
        Count the thrown exception and put the stack trace in the details portion of the key. This will allow the stack trace to be viewed in the JAMon web application.