Class WicketMetrics

java.lang.Object
org.apache.wicket.metrics.WicketMetrics
Direct Known Subclasses:
BehaviorCreateAspect, ComponentCreateAspect, ComponentOnConfigureAspect, ComponentOnDetachAspect, ComponentOnInitializeAspect, ComponentOnRenderAspect, ComponentSetResponsePageAspect, IPartialPageRequestHandlerAddAspect, IPartialPageRequestHandlerAppendJavaScriptAspect, IPartialPageRequestHandlerPrependJavaScriptAspect, IRequestHandlerDetachAspect, IRequestHandlerRespondAspect, IResourceCreateAspect, LoadableDetachableModelLoadAspect, ResourceReferenceCreateAspect, SessionCountListenerAspect, WicketFilterRequestCycleAspect, WicketFilterRequestCycleUrlAspect, WicketTagCreateAspect

public class WicketMetrics extends Object
Base aspect provides access to the metric registry
Author:
Tobias Soloschenko
  • Field Details

  • Constructor Details

  • Method Details

    • measureTime

      public Object measureTime(String name, org.aspectj.lang.ProceedingJoinPoint joinPoint) throws Throwable
      Simply measure the time for a @around
      Parameters:
      name - the name of the timer context
      joinPoint - the joinPoint to be proceed
      Returns:
      the value of the join point
      Throws:
      Throwable - if there is an exception while execution
      See Also:
    • measureTime

      public Object measureTime(String name, org.aspectj.lang.ProceedingJoinPoint joinPoint, boolean renderClass) throws Throwable
      Simply measure the time for a @around
      Parameters:
      name - the name of the timer context
      joinPoint - the joinPoint to be proceed
      renderClass - if the class name should be rendered behind the metric path
      Returns:
      the value of the join point
      Throws:
      Throwable - if there is an exception while execution
    • stopQuietly

      public void stopQuietly(com.codahale.metrics.Timer.Context context)
      Stops the context quietly
      Parameters:
      context - the context to stop
    • count

      public Object count(String name, org.aspectj.lang.ProceedingJoinPoint joinPoint, WicketMetrics.CounterOperation counterOperation, Long value) throws Throwable
      Creates a count of the given arguments
      Parameters:
      name - the name of the meter to be marked
      joinPoint - the join point
      counterOperation - the operation
      value - the value to update the counter
      Returns:
      the result of the proceeded join point
      Throws:
      Throwable
    • mark

      public Object mark(String name, org.aspectj.lang.ProceedingJoinPoint joinPoint) throws Throwable
      Marks the meter with the given name
      Parameters:
      name - the name of the meter to be marked
      joinPoint - the join point
      Returns:
      the result of the proceeded join point
      Throws:
      Throwable
    • renderClassName

      public String renderClassName(org.aspectj.lang.ProceedingJoinPoint joinPoint)
      Renders the class name of the given join point
      Parameters:
      joinPoint - the join point to get the class of
      Returns:
      the class name representation
    • getMetricRegistry

      public static com.codahale.metrics.MetricRegistry getMetricRegistry()
      Gets the metric registry
      Returns:
      the metric registry
    • getSettings

      Gets the wicket metrics settings
      Returns:
      the wicket metrics settings
    • getFilterName

      public static String getFilterName()
      Gets the filter name the application should be resolved with
      Returns:
      the filter name
    • setFilterName

      public static void setFilterName(String filterName)
      Sets the filter name the application should be resolved with
      Parameters:
      filterName - the filter name