Package org.eclipse.test.internal.performance.eval

Examples of org.eclipse.test.internal.performance.eval.StatisticsSession$Statistics


  private void printSample(PrintStream ps, Sample sample) {
    ps.print("Scenario '" + getScenarioName() + "' "); //$NON-NLS-1$ //$NON-NLS-2$
    DataPoint[] dataPoints= sample.getDataPoints();
    if (dataPoints.length > 0) {
      StatisticsSession s= new StatisticsSession(dataPoints);
      Dim[] dimensions= dataPoints[0].getDimensions();
      Arrays.sort(dimensions, new DimensionComparator());
      if (dimensions.length > 0) {
        List badDimensions= new ArrayList();
        long n= s.getCount(dimensions[0]);
        MessageFormat format= new MessageFormat("({0,number,percent} in [{1}, {2}])"); //$NON-NLS-1$

        String spaces= "                                                                                                       "; //$NON-NLS-1$

        ps.println("(average over " + n + " samples):"); //$NON-NLS-1$ //$NON-NLS-2$
        for (int i= 0; i < dimensions.length; i++) {
          Dim dimension= dimensions[i];
          double mean= s.getAverage(dimension);

          String nameString= "  " + dimension.getName() + ":"; //$NON-NLS-1$ //$NON-NLS-2$
          String meanString= dimension.getDisplayValue(mean);
          int align= firstNonDigit(meanString);
          meanString= spaces.substring(0, 30 - align - nameString.length()) + meanString;

          align= nameString.length() + meanString.length();

          Percentile percentile= StatisticsUtil.T95;
          double[] confidenceInterval= s.getConfidenceInterval(dimension, percentile);

          String confidenceString= n <= 2
          ? " (no confidence)" //$NON-NLS-1$
              : spaces.substring(0, 40 - align) + format.format(new Object[] {new Double(percentile.inside()), dimension.getDisplayValue(confidenceInterval[0]), dimension.getDisplayValue(confidenceInterval[1])});
View Full Code Here


        fSQL.createSummaryEntry(variation_id, scenario_id, 0, false, commentId); // use special dim id '0' to identify summary entry created to only handle a comment
            }
            int sample_id= fSQL.createSample(variation_id, scenario_id, new Timestamp(sample.getStartTime()));

            if (AGGREGATE) {
                StatisticsSession stats= new StatisticsSession(dataPoints);
                Dim[] dims= dataPoints[0].getDimensions();

                int datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.AVERAGE);
                for (int i= 0; i < dims.length; i++) {
                    Dim dim= dims[i];
                    fSQL.insertScalar(datapoint_id, dim.getId(), (long) stats.getAverage(dim));
                }
               
                datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.STDEV);
                for (int i= 0; i < dims.length; i++) {
                    Dim dim= dims[i];
                    // see StatisticsSession
                    long value= Double.doubleToLongBits(stats.getStddev(dim));
                    fSQL.insertScalar(datapoint_id, dim.getId(), value);
                }
               
                datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.SIZE);
                for (int i= 0; i < dims.length; i++) {
                    Dim dim= dims[i];
                    fSQL.insertScalar(datapoint_id, dim.getId(), stats.getCount(dim));
                }
        } else {
        for (int i= 0; i < dataPoints.length; i++) {
            DataPoint dp= dataPoints[i];
                int datapoint_id= fSQL.createDataPoint(sample_id, i, dp.getStep());
View Full Code Here

            v.put(fSharedState.fSeriesKey, fSeriesNames[t]);
            DataPoint[] dps= DB.queryDataPoints(v, fScenarioName, fSharedState.fQueryDimensions);
            if (DEBUG) System.err.println("  dps length: " + dps.length); //$NON-NLS-1$
            if (dps.length > 0) {
                dims.addAll(dps[0].getDimensions2());
                sessions.add(new StatisticsSession(dps));
                names2.add(fSeriesNames[t]);
            }
        }
        if (DEBUG) System.err.println("data: " + (System.currentTimeMillis()-start)); //$NON-NLS-1$
View Full Code Here

        fSQL.createSummaryEntry(variation_id, scenario_id, 0, false, commentId); // use special dim id '0' to identify summary entry created to only handle a comment
            }
            int sample_id= fSQL.createSample(variation_id, scenario_id, new Timestamp(sample.getStartTime()));

            if (AGGREGATE) {
                StatisticsSession stats= new StatisticsSession(dataPoints);
                Dim[] dims= dataPoints[0].getDimensions();

                int datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.AVERAGE);
                for (int i= 0; i < dims.length; i++) {
                    Dim dim= dims[i];
                    fSQL.insertScalar(datapoint_id, dim.getId(), (long) stats.getAverage(dim));
                }
               
                datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.STDEV);
                for (int i= 0; i < dims.length; i++) {
                    Dim dim= dims[i];
                    // see StatisticsSession
                    long value= Double.doubleToLongBits(stats.getStddev(dim));
                    fSQL.insertScalar(datapoint_id, dim.getId(), value);
                }
               
                datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.SIZE);
                for (int i= 0; i < dims.length; i++) {
                    Dim dim= dims[i];
                    fSQL.insertScalar(datapoint_id, dim.getId(), stats.getCount(dim));
                }
        } else {
        for (int i= 0; i < dataPoints.length; i++) {
            DataPoint dp= dataPoints[i];
                int datapoint_id= fSQL.createDataPoint(sample_id, i, dp.getStep());
View Full Code Here

  private void printSample(PrintStream ps, Sample sample) {
    ps.print("Scenario '" + getScenarioName() + "' "); //$NON-NLS-1$ //$NON-NLS-2$
    DataPoint[] dataPoints= sample.getDataPoints();
    if (dataPoints.length > 0) {
      StatisticsSession s= new StatisticsSession(dataPoints);
      Dim[] dimensions= dataPoints[0].getDimensions();
      Arrays.sort(dimensions, new DimensionComparator());
      if (dimensions.length > 0) {
        List badDimensions= new ArrayList();
        long n= s.getCount(dimensions[0]);
        MessageFormat format= new MessageFormat("({0,number,percent} in [{1}, {2}])"); //$NON-NLS-1$

        String spaces= "                                                                                                       "; //$NON-NLS-1$

        ps.println("(average over " + n + " samples):"); //$NON-NLS-1$ //$NON-NLS-2$
        for (int i= 0; i < dimensions.length; i++) {
          Dim dimension= dimensions[i];
          double mean= s.getAverage(dimension);

          String nameString= "  " + dimension.getName() + ":"; //$NON-NLS-1$ //$NON-NLS-2$
          String meanString= dimension.getDisplayValue(mean);
          int align= firstNonDigit(meanString);
          int endIndex = 30 - align - nameString.length();
          if (endIndex > 0) meanString= spaces.substring(0, endIndex) + meanString;

          align= nameString.length() + meanString.length();

          Percentile percentile= StatisticsUtil.T95;
          double[] confidenceInterval= s.getConfidenceInterval(dimension, percentile);

          StringBuffer printBuffer;
          if (n <= 2) {
            printBuffer = new StringBuffer(" (no confidence)"); //$NON-NLS-1$
          } else {
View Full Code Here

TOP

Related Classes of org.eclipse.test.internal.performance.eval.StatisticsSession$Statistics

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.