Search in sources :

Example 1 with RelativeBandChecker

use of org.eclipse.test.internal.performance.eval.RelativeBandChecker in project eclipse.platform.releng by eclipse.

the class Performance method assertPerformanceInRelativeBand.

/**
 * Asserts that the measurement specified by the dimension captured in the given performance meter is within a certain range
 * with respect to some reference value. If the performance meter doesn't provide the specified dimension, the call has no
 * effect.
 *
 * @param performanceMeter
 *            the performance meter
 * @param dim
 *            the Dimension to check
 * @param lowerPercentage
 *            a negative number indicating the percentage the measured value is allowed to be smaller than some reference value
 * @param 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
 */
public void assertPerformanceInRelativeBand(PerformanceMeter performanceMeter, Dimension dim, int lowerPercentage, int upperPercentage) {
    Evaluator e = new Evaluator();
    e.setAssertCheckers(new AssertChecker[] { new RelativeBandChecker((Dim) dim, 1.0 + (lowerPercentage / 100.0), 1.0 + (upperPercentage / 100.0)) });
    e.evaluate(performanceMeter);
}
Also used : RelativeBandChecker(org.eclipse.test.internal.performance.eval.RelativeBandChecker) Dim(org.eclipse.test.internal.performance.data.Dim) Evaluator(org.eclipse.test.internal.performance.eval.Evaluator) IEvaluator(org.eclipse.test.internal.performance.eval.IEvaluator)

Example 2 with RelativeBandChecker

use of org.eclipse.test.internal.performance.eval.RelativeBandChecker in project eclipse.platform.releng by eclipse.

the class Performance method assertPerformance.

/**
 * Asserts default properties of the measurements captured by the given performance meter.
 *
 * @param performanceMeter
 *            the performance meter
 * @throws RuntimeException
 *             if the properties do not hold
 */
public void assertPerformance(PerformanceMeter performanceMeter) {
    if (fDefaultEvaluator == null) {
        fDefaultEvaluator = new Evaluator();
        fDefaultEvaluator.setAssertCheckers(new AssertChecker[] { new RelativeBandChecker(InternalDimensions.ELAPSED_PROCESS, 0.0f, 1.10f) // new RelativeBandChecker(InternalDimensions.CPU_TIME, 0.0f, 1.10f),
        // new RelativeBandChecker(InternalDimensions.WORKING_SET, 0.0f, 3.00f),
        // new RelativeBandChecker(InternalDimensions.USED_JAVA_HEAP, 0.0f, 2.00f),
        // new RelativeBandChecker(InternalDimensions.SYSTEM_TIME, 0.0f, 1.10f)
        });
    }
    fDefaultEvaluator.evaluate(performanceMeter);
}
Also used : RelativeBandChecker(org.eclipse.test.internal.performance.eval.RelativeBandChecker) Evaluator(org.eclipse.test.internal.performance.eval.Evaluator) IEvaluator(org.eclipse.test.internal.performance.eval.IEvaluator)

Aggregations

Evaluator (org.eclipse.test.internal.performance.eval.Evaluator)2 IEvaluator (org.eclipse.test.internal.performance.eval.IEvaluator)2 RelativeBandChecker (org.eclipse.test.internal.performance.eval.RelativeBandChecker)2 Dim (org.eclipse.test.internal.performance.data.Dim)1