Package org.apache.wicket.metrics
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WicketMetrics.CounterOperation
-
Field Summary
Fields Modifier and Type Field Description static MetaDataKey<com.codahale.metrics.MetricRegistry>
METRIC_REGISTRY
The key for metrics registrystatic MetaDataKey<WicketMetricsSettings>
METRIC_SETTINGS
The key for metrics registry
-
Constructor Summary
Constructors Constructor Description WicketMetrics()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
count(String name, org.aspectj.lang.ProceedingJoinPoint joinPoint, WicketMetrics.CounterOperation counterOperation, Long value)
Creates a count of the given argumentsstatic String
getFilterName()
Gets the filter name the application should be resolved withstatic com.codahale.metrics.MetricRegistry
getMetricRegistry()
Gets the metric registrystatic WicketMetricsSettings
getSettings()
Gets the wicket metrics settingsObject
mark(String name, org.aspectj.lang.ProceedingJoinPoint joinPoint)
Marks the meter with the given nameObject
measureTime(String name, org.aspectj.lang.ProceedingJoinPoint joinPoint)
Simply measure the time for a @aroundObject
measureTime(String name, org.aspectj.lang.ProceedingJoinPoint joinPoint, boolean renderClass)
Simply measure the time for a @aroundString
renderClassName(org.aspectj.lang.ProceedingJoinPoint joinPoint)
Renders the class name of the given join pointstatic void
setFilterName(String filterName)
Sets the filter name the application should be resolved withvoid
stopQuietly(com.codahale.metrics.Timer.Context context)
Stops the context quietly
-
-
-
Field Detail
-
METRIC_REGISTRY
public static final MetaDataKey<com.codahale.metrics.MetricRegistry> METRIC_REGISTRY
The key for metrics registry
-
METRIC_SETTINGS
public static final MetaDataKey<WicketMetricsSettings> METRIC_SETTINGS
The key for metrics registry
-
-
Constructor Detail
-
WicketMetrics
public WicketMetrics()
-
-
Method Detail
-
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 contextjoinPoint
- the joinPoint to be proceed- Returns:
- the value of the join point
- Throws:
Throwable
- if there is an exception while execution- See Also:
measureTime(String, ProceedingJoinPoint, boolean)
-
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 contextjoinPoint
- the joinPoint to be proceedrenderClass
- 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 markedjoinPoint
- the join pointcounterOperation
- the operationvalue
- 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 markedjoinPoint
- 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
public static WicketMetricsSettings 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
-
-