Package com.google.test.metric.report.chart

Examples of com.google.test.metric.report.chart.Histogram


  public MultiHistogramDataModel buildHistogramDataModel(List<Integer> costs,
      Function<Integer, Double> scalingFunction) {
    int binCount = min(MAX_HISTOGRAM_BINS, 10 * (int) log(costs.size()) + 1);
    int binWidth = (int) ceil((double) findMax(costs) / binCount);
    Histogram overallHistogram = new Histogram(0, binWidth, binCount, scalingFunction);
    Histogram excellentHistogram = new Histogram(0, binWidth, binCount, scalingFunction);
    Histogram goodHistogram = new Histogram(0, binWidth, binCount, scalingFunction);
    Histogram needsWorkHistogram = new Histogram(0, binWidth, binCount, scalingFunction);
    for (int overallCost : costs) {
      if (overallCost <= maxExcellentCost) {
        excellentHistogram.value(overallCost);
      } else if (overallCost <= maxAcceptableCost) {
        goodHistogram.value(overallCost);
      } else {
        needsWorkHistogram.value(overallCost);
      }
      overallHistogram.value(overallCost);
    }
    int maxBin = overallHistogram.getMaxBin();
    excellentHistogram.setMaxBin(maxBin);
    goodHistogram.setMaxBin(maxBin);
    needsWorkHistogram.setMaxBin(maxBin);

    return new MultiHistogramDataModel(excellentHistogram, goodHistogram, needsWorkHistogram,
        overallHistogram, binCount, binWidth);
  }
View Full Code Here

TOP

Related Classes of com.google.test.metric.report.chart.Histogram

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.