Class ProfilingAspect

  • All Implemented Interfaces:
    Profiler

    public class ProfilingAspect
    extends AbstractProfilingAspect
    Default profiling aspect, which uses an injected ProfilingReportTemplate for storing the collected data.

    Sample Spring configuration: (core-profiling-spring.xml)

     <aop:config proxy-target-class="true">
            <aop:aspect id="serviceLayerProfilerAspect" ref="defaultProfiler">
                    <aop:pointcut id="profiledMethods" expression="execution(* de.hybris.platform.servicelayer..*.*(..))" />
                    <aop:around pointcut-ref="profiledMethods" method="basicProfiling" />
            </aop:aspect>
     </aop:config>
    
     <bean id="defaultProfiler" class="de.hybris.platform.aop.ProfilingAspect" scope="tenant">
            <property name="report" ref="profilingReportBean" />
     </bean>
     
    Note:For changing the profiling behaviour, you have to modify the defined 'pointcut' for your needs.
    • Constructor Detail

      • ProfilingAspect

        public ProfilingAspect()
    • Method Detail

      • setTenant

        public void setTenant​(Tenant tenant)
      • logExecutionTime

        public java.lang.Object logExecutionTime​(org.aspectj.lang.ProceedingJoinPoint pjp)
                                          throws java.lang.Throwable
        This methods will be called by the following sample AOP pointcut (core-profilig-spring.xml)
         <aop:pointcut id="profiledMethods" expression="execution(* de.hybris.platform.servicelayer..*.*(..))" />
         <aop:around pointcut-ref="profiledMethods" method="logExecutionTime" />
         
        Parameters:
        pjp - pointcut info
        Returns:
        execution result
        Throws:
        java.lang.Throwable