Search in sources :

Example 6 with Variations

use of org.eclipse.test.internal.performance.db.Variations in project eclipse.platform.releng by eclipse.

the class PerformanceTestPlugin method getDBName.

public static String getDBName() {
    String dbloc = System.getProperty(ECLIPSE_PERF_DBLOC);
    if (dbloc != null) {
        // $NON-NLS-1$ //$NON-NLS-2$
        logInfo("System property " + ECLIPSE_PERF_DBLOC + " found to equal " + dbloc + " in getDBName");
        Variations keys = new Variations();
        keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
        return keys.getProperty(DB_NAME, DEFAULT_DB_NAME);
    }
    return DEFAULT_DB_NAME;
}
Also used : Variations(org.eclipse.test.internal.performance.db.Variations)

Example 7 with Variations

use of org.eclipse.test.internal.performance.db.Variations in project eclipse.platform.releng by eclipse.

the class VariationsTests method testParseVariations.

public void testParseVariations() {
    Variations v1 = new Variations();
    // $NON-NLS-1$ //$NON-NLS-2$
    v1.put("k1", "foo");
    Variations v = new Variations();
    v.parseDB(v1.toExactMatchString());
    assertEquals(v1, v);
    Variations v2 = new Variations();
    // $NON-NLS-1$ //$NON-NLS-2$
    v2.put("k1", "foo");
    // $NON-NLS-1$ //$NON-NLS-2$
    v2.put("k2", "bar");
    v = new Variations();
    v.parseDB(v2.toExactMatchString());
    assertEquals(v2, v);
    Variations v3 = new Variations();
    // $NON-NLS-1$ //$NON-NLS-2$
    v3.put("k1", "foo");
    // $NON-NLS-1$ //$NON-NLS-2$
    v3.put("k2", "bar");
    // $NON-NLS-1$ //$NON-NLS-2$
    v3.put("k3", "xyz");
    v = new Variations();
    v.parseDB(v3.toExactMatchString());
    assertEquals(v3, v);
}
Also used : Variations(org.eclipse.test.internal.performance.db.Variations)

Example 8 with Variations

use of org.eclipse.test.internal.performance.db.Variations in project eclipse.platform.releng by eclipse.

the class DBTests method testBasicDBFunctionality.

public void testBasicDBFunctionality() {
    Performance perf = Performance.getDefault();
    TestPerformanceMeter pm1 = new TestPerformanceMeter(SCENARIO_NAME_1);
    pm1.addPair(InternalDimensions.CPU_TIME, 100, 1000);
    pm1.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
    pm1.start();
    pm1.stop();
    pm1.commit();
    pm1.dispose();
    TestPerformanceMeter pm2 = new TestPerformanceMeter(SCENARIO_NAME_2);
    pm2.addPair(InternalDimensions.CPU_TIME, 100, 1000);
    pm2.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
    perf.tagAsGlobalSummary(pm2, SHORT_NAME_2, new Dimension[] { Dimension.CPU_TIME, Dimension.USED_JAVA_HEAP });
    pm2.start();
    pm2.stop();
    pm2.commit();
    pm2.dispose();
    TestPerformanceMeter pm3 = new TestPerformanceMeter(SCENARIO_NAME_3);
    pm3.addPair(InternalDimensions.CPU_TIME, 100, 1000);
    pm3.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
    perf.tagAsGlobalSummary(pm3, SHORT_NAME_3, Dimension.CPU_TIME);
    pm3.start();
    pm3.stop();
    pm3.commit();
    pm3.dispose();
    TestPerformanceMeter pm4 = new TestPerformanceMeter(SCENARIO_NAME_4);
    pm4.addPair(InternalDimensions.CPU_TIME, 100, 1000);
    pm4.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
    perf.tagAsSummary(pm4, SHORT_NAME_4, Dimension.USED_JAVA_HEAP);
    pm4.start();
    pm4.stop();
    pm4.commit();
    pm4.dispose();
    // 
    Variations v = new Variations();
    // $NON-NLS-1$
    v.put(CONFIG, "test");
    // $NON-NLS-1$
    v.put(BUILD, "b0001");
    // $NON-NLS-1$ //$NON-NLS-2$
    v.put("jvm", "sun142");
    DataPoint[] points = DB.queryDataPoints(v, SCENARIO_NAME_1, null);
    assertEquals(1, points.length);
    DataPoint dp = points[0];
    Dim[] dimensions = dp.getDimensions();
    assertEquals(2, dimensions.length);
    Scalar s1 = dp.getScalar(InternalDimensions.CPU_TIME);
    assertNotNull(s1);
    assertEquals(900, s1.getMagnitude());
    Scalar s2 = dp.getScalar(InternalDimensions.WORKING_SET);
    assertNotNull(s2);
    assertEquals(1000, s2.getMagnitude());
    // 
    Set<Dim> dims = new HashSet<>();
    dims.add(InternalDimensions.WORKING_SET);
    points = DB.queryDataPoints(v, SCENARIO_NAME_1, dims);
    assertEquals(1, points.length);
    dimensions = points[0].getDimensions();
    assertEquals(1, dimensions.length);
    Scalar s = points[0].getScalar(InternalDimensions.WORKING_SET);
    assertNotNull(s);
    assertEquals(1000, s.getMagnitude());
    // 
    List<String> buildNames = new ArrayList<>();
    Variations v2 = new Variations();
    // $NON-NLS-1$
    v2.put(CONFIG, "%");
    // $NON-NLS-1$
    v2.put(BUILD, "b%");
    // $NON-NLS-1$
    DB.queryDistinctValues(buildNames, BUILD, v2, "%");
    assertEquals(1, buildNames.size());
    // $NON-NLS-1$
    assertEquals("b0001", buildNames.get(0));
    SummaryEntry[] fps = DB.querySummaries(PerformanceTestPlugin.getVariations(), null);
    assertEquals(3, fps.length);
    assertEquals(SCENARIO_NAME_2, fps[0].scenarioName);
    assertEquals(SHORT_NAME_2, fps[0].shortName);
    assertEquals(Dimension.USED_JAVA_HEAP, fps[0].dimension);
    assertEquals(SCENARIO_NAME_2, fps[1].scenarioName);
    assertEquals(SHORT_NAME_2, fps[1].shortName);
    assertEquals(Dimension.CPU_TIME, fps[1].dimension);
    assertEquals(SCENARIO_NAME_3, fps[2].scenarioName);
    assertEquals(SHORT_NAME_3, fps[2].shortName);
    assertEquals(Dimension.CPU_TIME, fps[2].dimension);
    // $NON-NLS-1$
    SummaryEntry[] fps2 = DB.querySummaries(PerformanceTestPlugin.getVariations(), "foo.%");
    assertEquals(2, fps2.length);
    assertEquals(SCENARIO_NAME_3, fps2[0].scenarioName);
    assertEquals(SHORT_NAME_3, fps2[0].shortName);
    assertEquals(Dimension.CPU_TIME, fps2[0].dimension);
    assertEquals(SCENARIO_NAME_4, fps2[1].scenarioName);
    assertEquals(SHORT_NAME_4, fps2[1].shortName);
    assertEquals(Dimension.USED_JAVA_HEAP, fps2[1].dimension);
}
Also used : Variations(org.eclipse.test.internal.performance.db.Variations) ArrayList(java.util.ArrayList) Dim(org.eclipse.test.internal.performance.data.Dim) Scalar(org.eclipse.test.internal.performance.data.Scalar) DataPoint(org.eclipse.test.internal.performance.data.DataPoint) SummaryEntry(org.eclipse.test.internal.performance.db.SummaryEntry) Performance(org.eclipse.test.performance.Performance) HashSet(java.util.HashSet)

Example 9 with Variations

use of org.eclipse.test.internal.performance.db.Variations in project eclipse.platform.releng by eclipse.

the class PerformanceTestPlugin method getDBLocation.

/*
   * -Declipse.perf.dbloc=net://localhost
   */
public static String getDBLocation() {
    String dbloc = System.getProperty(ECLIPSE_PERF_DBLOC);
    if (dbloc != null) {
        // $NON-NLS-1$ //$NON-NLS-2$
        logInfo("System property " + ECLIPSE_PERF_DBLOC + " found to equal " + dbloc + " in getDBLocation");
        Variations keys = new Variations();
        keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
        return keys.getProperty(ECLIPSE_PERF_DBLOC);
    }
    return null;
}
Also used : Variations(org.eclipse.test.internal.performance.db.Variations)

Example 10 with Variations

use of org.eclipse.test.internal.performance.db.Variations in project eclipse.platform.releng by eclipse.

the class PerformanceTestPlugin method getDBPassword.

public static String getDBPassword() {
    String dbloc = System.getProperty(ECLIPSE_PERF_DBLOC);
    if (dbloc != null) {
        // $NON-NLS-1$ //$NON-NLS-2$
        logInfo("System property " + ECLIPSE_PERF_DBLOC + " found to equal " + dbloc + " in getDBPassword");
        Variations keys = new Variations();
        keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
        return keys.getProperty(DB_PASSWD, DEFAULT_DB_PASSWORD);
    }
    return DEFAULT_DB_PASSWORD;
}
Also used : Variations(org.eclipse.test.internal.performance.db.Variations)

Aggregations

Variations (org.eclipse.test.internal.performance.db.Variations)11 HashSet (java.util.HashSet)2 DataPoint (org.eclipse.test.internal.performance.data.DataPoint)2 Dim (org.eclipse.test.internal.performance.data.Dim)2 Performance (org.eclipse.test.performance.Performance)2 ArrayList (java.util.ArrayList)1 AssertionFailedError (junit.framework.AssertionFailedError)1 InternalPerformanceMeter (org.eclipse.test.internal.performance.InternalPerformanceMeter)1 Sample (org.eclipse.test.internal.performance.data.Sample)1 Scalar (org.eclipse.test.internal.performance.data.Scalar)1 Scenario (org.eclipse.test.internal.performance.db.Scenario)1 SummaryEntry (org.eclipse.test.internal.performance.db.SummaryEntry)1