Package org.eclipse.test.internal.performance.data

Examples of org.eclipse.test.internal.performance.data.Scalar


    String scenarioId = performanceResult.getClassName() + "." + performanceResult.getName();

    DataPoint[] points = new DataPoint[2];

    Map<Dimension, Scalar> map = new HashMap<Dimension, Scalar>();
    map.put(Dimension.CPU_TIME, new Scalar((Dim) Dimension.CPU_TIME, 0));
    points[0] = new DataPoint(0, map);

    map = new HashMap<Dimension, Scalar>();
    map.put(Dimension.CPU_TIME, new Scalar((Dim) Dimension.CPU_TIME, (long) performanceResult.getTime() * 1000));
    points[1] = new DataPoint(1, map);

    final Sample sample = new Sample(scenarioId, System.currentTimeMillis(), Collections.EMPTY_MAP, points);
    sample.tagAsSummary(true, performanceResult.getName(), new Dimension[] {Dimension.CPU_TIME}, 0, null);
    Variations variations = PerformanceTestPlugin.getVariations();
View Full Code Here


  protected void collectGlobalPerformanceInfo(Map scalars) {
    // no default implementation
  }
 
    void addScalar(Map scalars, Dim dimension, long value) {
        scalars.put(dimension, new Scalar(dimension, value));
    }
View Full Code Here

      super(scenarioId);
    fStartTime= System.currentTimeMillis();
  }
   
    void addPair(Dim dimension, long start, long end) {
      fStart.put(dimension, new Scalar(dimension, start));       
      fStop.put(dimension, new Scalar(dimension, end));       
    }
View Full Code Here

   
    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 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 buildNames= new ArrayList();
    Variations v2= new Variations();
    v2.put(CONFIG, "%"); //$NON-NLS-1$
View Full Code Here

        double stdevSum= 0;
       
//        Set acquiredAggregates= new HashSet();
        for (int i= 0; i < fDataPoints.length; i++) {
            DataPoint point= fDataPoints[i];
            Scalar scalar= point.getScalar(dimension);
            if (scalar == null)
                continue;
           
            Integer aggregate= new Integer(point.getStep());
            // allow for multiple measurements that were each stored with their own
            // aggregate values
//            Assert.assertTrue(acquiredAggregates.add(aggregate));
           
            long magnitude= scalar.getMagnitude();
            switch (aggregate.intValue()) {
                case InternalPerformanceMeter.AVERAGE:
                    averageSum += magnitude;
                    aggregateCount++;
                    break;
View Full Code Here

        return new Sample(getScenarioName(), fStartDate, properties, data);
    }

  private DataPoint createDataPoint(int step, Dim dimension, long value) {
    Map scalars= new HashMap();
    scalars.put(dimension, new Scalar(dimension, value));
    return new DataPoint(step, scalars);
  }
View Full Code Here

        switch (steps.size()) {
            case 1:
                // if there is only one Step, we don't calculate the delta. happens for startup tests
                mags= new long[fDataPoints.length];
                for (int i= 0; i < fDataPoints.length; i++) {
                    Scalar sc= fDataPoints[i].getScalar(dimension);
                    mags[i]= sc == null ? 0 : sc.getMagnitude();
                }
                break;
            case 2:
                int count= fDataPoints.length / 2;
                mags= new long[count];
                for (int i= 0; i < count; i ++) {
                    DataPoint before= fDataPoints[2 * i];
                    Assert.assertTrue("wrong order of steps", before.getStep() == InternalPerformanceMeter.BEFORE); //$NON-NLS-1$
                    DataPoint after= fDataPoints[2 * i + 1];
                    Assert.assertTrue("wrong order of steps", after.getStep() == InternalPerformanceMeter.AFTER); //$NON-NLS-1$

                    Scalar delta= getDelta(before, after, dimension);
                    long magnitude= delta.getMagnitude();
                    mags[i]= magnitude;
                }
                break;
            default:
                Assert.fail("cannot handle more than two steps in measurement mode"); //$NON-NLS-1$
View Full Code Here

       
        return stats;
    }

  private Scalar getDelta(DataPoint before, DataPoint after, Dim dimension) {
    Scalar one= before.getScalar(dimension);
    Assert.assertTrue("reference has no value for dimension " + dimension, one != null); //$NON-NLS-1$

    Scalar two= after.getScalar(dimension);
    Assert.assertTrue("reference has no value for dimension " + dimension, two != null); //$NON-NLS-1$
   
    return new Scalar(one.getDimension(), two.getMagnitude() - one.getMagnitude());
  }
View Full Code Here

        for (int i= 0; i < dataPoints.length; i++) {
            DataPoint dp= dataPoints[i];
                int datapoint_id= fSQL.createDataPoint(sample_id, i, dp.getStep());
            Scalar[] scalars= dp.getScalars();
             for (int j= 0; j < scalars.length; j++) {
                Scalar scalar= scalars[j];
                int dim_id= scalar.getDimension().getId();
                long value= scalar.getMagnitude();         
            fSQL.insertScalar(datapoint_id, dim_id, value);
            }
        }
        }
     
View Full Code Here

                  int dim_id= rs2.getInt(1);
                  long value= rs2.getBigDecimal(2).longValue();               
                  Dim dim= Dim.getDimension(dim_id);
                  if (dim != null) {
                      if (dimSet == null || dimSet.contains(dim))
                          map.put(dim, new Scalar(dim, value));
                  }
            }
            if (map.size() > 0)
                dataPoints.add(new DataPoint(step, map));
           
View Full Code Here

TOP

Related Classes of org.eclipse.test.internal.performance.data.Scalar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.