Class AbstractProfilingAspect

    • Constructor Detail

      • AbstractProfilingAspect

        public AbstractProfilingAspect​(String topLevelMethod,
                                       Map<String,​CustomPerformanceMeter> methodMetrics)
        Constructor
        Parameters:
        topLevelMethod - name of the profiling method, can't be null
        methodMetrics - need for accumulation performance metrics by performance scenario name, can't be null
    • Method Detail

      • afterTestStop

        public void afterTestStop​(org.aspectj.lang.JoinPoint joinPoint)
        Special aspect code that will be executed after testing method linking through "Pointcut" "afterTestStop"
        Parameters:
        joinPoint - actual JoinPoint, can't be null
      • beforeTestStart

        public void beforeTestStart​(org.aspectj.lang.JoinPoint joinPoint)
        Special aspect code that will be executed before testing method linking through "Pointcut" "beforeTestStart"
        Parameters:
        joinPoint - actual JoinPoint, can't be null
      • profile

        protected abstract void profile()
        Special "Pointcut" for linking real aspect class with profiling method. Special aspect code will be executed around the linking method
      • afterTestStop

        protected void afterTestStop()
        Default implementation will execute all test*() methods with afterTestStop(JoinPoint) aspect.
      • beforeTestStart

        protected void beforeTestStart()
        Default implementation will execute all test*() methods with beforeTestStart(JoinPoint) aspect.
      • getScenarioName

        protected String getScenarioName​(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint)
        Gets scenario name. The name contains name of the test class and test method
        Parameters:
        thisJoinPoint - actual ProceedingJoinPoint of profiling method, can't be null
        Returns:
        Scenario name, never null
      • getDimensions

        protected org.eclipse.test.performance.Dimension[] getDimensions()
        Gets all Dimension which will be measured during profiling
        Returns:
        list of Dimension, never null
      • getShortScenarioName

        protected String getShortScenarioName​(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint)
        Gets short scenario name for profiling method.
        Parameters:
        thisJoinPoint - actual ProceedingJoinPoint of profiling method, can't be null
        Returns:
        a short (shorter than 40 characters) descriptive name of the scenario, never null
      • assertPerformanceInRelativeBand

        protected void assertPerformanceInRelativeBand​(org.eclipse.test.performance.PerformanceMeter performanceMeter,
                                                       org.eclipse.test.performance.Dimension dim,
                                                       int lowerPercentage,
                                                       int upperPercentage)
        Asserts that the measurement specified by the given dimension is within a certain range with respect to some reference value. If the specified dimension isn't available, the call has no effect.
        Parameters:
        performanceMeter - actual PerformanceMeter, can't be null
        dim - the Dimension to check
        lowerPercentage - a negative number indicating the percentage the measured value is allowed to be smaller than some reference value
        upperPercentage - a positive number indicating the percentage the measured value is allowed to be greater than some reference value
        Throws:
        RuntimeException - if the properties do not hold
      • getPerformanceMeter

        protected CustomPerformanceMeter getPerformanceMeter​(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint)
        Gets special performance meter for accumulation profiling metrics
        Parameters:
        thisJoinPoint - actual ProceedingJoinPoint of profiling method, can't be null
        Returns:
        special performance meter for accumulation profiling metrics, never null