public abstract class AbstractProfilingAspect extends Object implements Profiler
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractProfilingAspect.Accuracy |
| Modifier and Type | Field and Description |
|---|---|
protected Enum |
accuracy |
protected String |
aspectNodeName |
protected String |
domain |
protected long |
limit |
protected Class<?> |
template |
| Constructor and Description |
|---|
AbstractProfilingAspect() |
| Modifier and Type | Method and Description |
|---|---|
protected long |
calculateExecutionTime(long startTime) |
protected MBeanInfoAssembler |
getAssembler() |
protected ObjectInstance |
getOrCreateMBean(Object resource,
String method)
Creates or returns a MBean instance for the specified method
|
protected ObjectInstance |
getOrCreateResource(Class template,
String profiledMethod)
Wrapper method for getOrCreateMBean method.
|
protected abstract Tenant |
getOwnTenant() |
protected long |
getTime()
Returns the current time in the specified time unit
setAccuracy(String) |
void |
logException(ObjectInstance bean)
This method will be used for incrementing an internal "failed execution counter"
|
void |
logExecutionTime(ObjectInstance bean,
long executionTime,
long calledAt)
Logs the execution time of the currently profiled method
|
void |
setAccuracy(String accuracy)
Setter of the time measure accuracy (use 'ns' for nano seconds , 'ms' for milliseconds [default])
|
void |
setAspectNodeName(String aspectNodeName)
Setter of the JMX node name (this node will appear below 'hybris/{Tenant ID}')
|
void |
setAssembler(MBeanInfoAssembler assembler)
assembler for gathering required MBeanInfo object for a bean
|
void |
setDomain(String domain)
Setter of the JMX domain.
|
void |
setLimit(long limit)
Sets the minimum method execution time.
|
void |
setTemplate(Class<? extends ProfilingReportBean> template)
Setter for the
ProfilingReportBean instance. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlogExecutionTimeprotected Class<?> template
protected String domain
protected String aspectNodeName
protected Enum accuracy
protected long limit
protected MBeanInfoAssembler getAssembler()
public void setAssembler(MBeanInfoAssembler assembler)
public void setTemplate(Class<? extends ProfilingReportBean> template)
ProfilingReportBean instance.template - the templatepublic void setAspectNodeName(String aspectNodeName)
aspectNodeName - the JMX node name (default is the class name of the aspect)public void setAccuracy(String accuracy)
accuracy - the time unitpublic void setDomain(String domain)
JmxUtils.DEFAULT_JMX_DOMAINpublic void setLimit(long limit)
protected long getTime()
setAccuracy(String)protected long calculateExecutionTime(long startTime)
protected ObjectInstance getOrCreateMBean(Object resource, String method) throws JMException, InvalidTargetObjectTypeException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
resource - an implementation of ProfilingReportBeanmethod - the profiled methodJMExceptionInvalidTargetObjectTypeExceptionInvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionIllegalArgumentExceptionprotected abstract Tenant getOwnTenant()
protected ObjectInstance getOrCreateResource(Class template, String profiledMethod) throws InstantiationException, IllegalAccessException, IllegalArgumentException, JMException, InvalidTargetObjectTypeException, InvocationTargetException
template - an implementation of ProfilingReportBeanprofiledMethod - the profiled methodJMExceptionInvalidTargetObjectTypeExceptionInvocationTargetExceptionIllegalAccessExceptionInstantiationExceptionIllegalArgumentExceptionpublic void logExecutionTime(ObjectInstance bean, long executionTime, long calledAt) throws JMException, InvalidTargetObjectTypeException
bean - the used bean for "displaying" the profiled data via JMXexecutionTime - the execution timecalledAt - the start timeJMExceptionInvalidTargetObjectTypeExceptionpublic void logException(ObjectInstance bean) throws JMException, InvalidTargetObjectTypeException
bean - the JMX bean which will be notified about the notified execution of its corresponding methodJMExceptionInvalidTargetObjectTypeExceptionCopyright © 2017 SAP SE. All Rights Reserved.