Package com.tagtraum.perf.gcviewer.util

Examples of com.tagtraum.perf.gcviewer.util.FormattedValue


  }

    private FormattedValue sigmaMemoryFormat(double value) {
        if (Double.isNaN(value)) {
          StringBuffer buffer = new StringBuffer("NaN");
          return new FormattedValue(buffer, ' ');
        }
        return sigmaMemoryFormatter.formatToFormatted(value);
    }
View Full Code Here


  }

  private void exportOverallSummary(PrintWriter out, GCModel model) {
    exportValue(out, "accumPause", gcTimeFormatter.format(model.getPause().getSum()), "s");
   
    FormattedValue formed = footprintFormatter.formatToFormatted(model.getFootprint());
    exportValue(out, "footprint", formed.getValue(), formed.getUnits());
   
    formed = footprintFormatter.formatToFormatted(model.getFreedMemory());   
    exportValue(out, "freedMemory", formed.getValue(), formed.getUnits());
   
    if (model.hasCorrectTimestamp()) {
      exportValue(out, "throughput", throughputFormatter.format(model.getThroughput()), "%");
      formed = totalTimeFormatter.formatToFormatted(new Date((long)model.getRunningTime()*1000l));
      exportValue(out, "totalTime", formed.getValue(), formed.getUnits());
     
      formed = freedMemoryPerMinFormatter.formatToFormatted(model.getFreedMemory()/model.getRunningTime()*60.0);
      exportValue(out, "freedMemoryPerMin", formed.getValue(), formed.getUnits() + "/min");
    }
    else {
      exportValue(out, "throughput", "n.a.", "%");
      exportValue(out, "totalTime", "n.a.", "s");
      exportValue(out, "freedMemoryPerMin", "n.a.", "M/min");
    }

    final boolean gcDataAvailable = model.getGCPause().getN() > 0;
    if (gcDataAvailable) {
      formed = footprintFormatter.formatToFormatted(model.getFreedMemoryByGC().getSum()/model.getGCPause().getSum());
      exportValue(out, "gcPerformance", formed.getValue(), formed.getUnits() + "/s");
    }
    else {
      exportValue(out, "gcPerformance", "n.a.", "M/s");
    }

    final boolean fullGCDataAvailable = model.getFullGCPause().getN() > 0;

    if (fullGCDataAvailable) {
      formed = footprintFormatter.formatToFormatted(model.getFreedMemoryByFullGC().getSum()/model.getFullGCPause().getSum());
      exportValue(out, "fullGCPerformance", formed.getValue(), formed.getUnits() + "/s");
    }
    else {
      exportValue(out, "fullGCPerformance", "n.a.", "M/s");
    }
  }
View Full Code Here

    // Note: this may or may not be a good measure, but it at least helps to mark some bad data as such
    return average-standardDeviation > 0.75 * average;
  }

  private void exportMemorySummary(PrintWriter out, GCModel model) {
    FormattedValue formed = footprintFormatter.formatToFormatted(model.getFootprint());
    exportValue(out, "footprint", formed.getValue(), formed.getUnits());
   
    // check whether we have full gc data at all
    final boolean fullGCDataVailable = model.getFootprintAfterFullGC().getN() != 0;
    final boolean fullGCSlopeDataVailable = model.getFootprintAfterFullGC().getN() > 1;

    if (!fullGCDataVailable) {
      exportValue(out, "footprintAfterFullGC", "n.a.", "M");
      exportValue(out, "slopeAfterFullGC", "n.a.", "M/s");
      exportValue(out, "freedMemoryByFullGC", "n.a.", "M");
      exportValue(out, "avgFreedMemoryByFullGC", "n.a.", "M");
      exportValue(out, "avgFreedMemoryByFullGC\u03c3", "n.a.", "M");
      exportValue(out, "avgFreedMemoryByFullGCisSig", "n.a.", "bool");
    }
    else {
      formed = footprintFormatter.formatToFormatted(model.getFootprintAfterFullGC().average());
      exportValue(out, "avgfootprintAfterFullGC", formed.getValue(), formed.getUnits());
      formed = sigmaMemoryFormat(model.getFootprintAfterFullGC().standardDeviation());
      exportValue(out, "avgfootprintAfterFullGC\u03c3", formed.getValue(), formed.getUnits());
      exportValue(out, "avgfootprintAfterFullGCisSig", isSignificant(model.getFootprintAfterFullGC().average(),
          model.getFootprintAfterFullGC().standardDeviation()));
      formed = footprintFormatter.formatToFormatted(model.getFreedMemoryByFullGC().getSum());
      exportValue(out, "freedMemoryByFullGC", formed.getValue(), formed.getUnits());
      exportValue(out, "freedMemoryByFullGCpc", percentFormatter.format(model.getFreedMemoryByFullGC().getSum()*100.0/model.getFreedMemory()), "%");
     
      formed = footprintFormatter.formatToFormatted(model.getFreedMemoryByFullGC().average());
      exportValue(out, "avgFreedMemoryByFullGC", formed.getValue(), formed.getUnits() + "/coll");
      formed = sigmaMemoryFormat(model.getFreedMemoryByFullGC().standardDeviation());
      exportValue(out, "avgFreedMemoryByFullGC\u03c3", formed.getValue(), formed.getUnits() + "/coll");
      exportValue(out, "avgFreedMemoryByFullGCisSig", isSignificant(model.getFreedMemoryByFullGC().average(),
          model.getFreedMemoryByFullGC().standardDeviation()));
      if (fullGCSlopeDataVailable) {
        formed = footprintSlopeFormatter.formatToFormatted(model.getPostFullGCSlope().slope());
        exportValue(out, "slopeAfterFullGC", formed.getValue(), formed.getUnits() + "/s");
       
        formed = footprintSlopeFormatter.formatToFormatted(model.getRelativePostFullGCIncrease().slope());
        exportValue(out, "avgRelativePostFullGCInc", formed.getValue(), formed.getUnits() + "/coll");
      }
      else {
        exportValue(out, "slopeAfterFullGC", "n.a.", "M/s");
        exportValue(out, "avgRelativePostFullGCInc", "n.a.", "M/coll");
      }
    }
    // check whether we have gc data at all (or only full gc)
    final boolean gcDataAvailable = model.getFootprintAfterGC().getN() != 0;

    if (!gcDataAvailable) {
      exportValue(out, "footprintAfterGC", "n.a.", "M");
      exportValue(out, "slopeAfterGC", "n.a.", "M/s");
      exportValue(out, "freedMemoryByGC", "n.a.", "M");
      exportValue(out, "avgFreedMemoryByGC", "n.a.", "M/coll");
      exportValue(out, "avgRelativePostGCInc", "n.a.", "M/coll");
    }
    else {
      formed = footprintFormatter.formatToFormatted(model.getFootprintAfterGC().average());
      exportValue(out, "avgfootprintAfterGC", formed.getValue(), formed.getUnits());
     
      formed = sigmaMemoryFormat(model.getFootprintAfterGC().standardDeviation());
      exportValue(out, "avgfootprintAfterGC\u03c3", formed.getValue(), formed.getUnits());
      exportValue(out, "avgfootprintAfterGCisSig", isSignificant(model.getFootprintAfterGC().average(),
          model.getFootprintAfterGC().standardDeviation()));
      if (fullGCDataVailable && model.getRelativePostGCIncrease().getN() != 0) {
        formed = footprintSlopeFormatter.formatToFormatted(model.getPostGCSlope());
        exportValue(out, "slopeAfterGC", formed.getValue(), formed.getUnits() + "/s");
       
        formed = footprintSlopeFormatter.formatToFormatted(model.getRelativePostGCIncrease().average());
        exportValue(out, "avgRelativePostGCInc", formed.getValue(), formed.getUnits() + "/coll");
      }
      else {
        exportValue(out, "slopeAfterGC", "n.a.", "M/s");
        exportValue(out, "avgRelativePostGCInc", "n.a.", "M/coll");
      }
     
      formed = footprintFormatter.formatToFormatted(model.getFreedMemoryByGC().getSum());
      exportValue(out, "freedMemoryByGC", formed.getValue(), formed.getUnits());
     
      exportValue(out, "freedMemoryByGCpc", percentFormatter.format(model.getFreedMemoryByGC().getSum()*100.0/model.getFreedMemory()), "%");
     
      formed = footprintFormatter.formatToFormatted(model.getFreedMemoryByGC().average());
      exportValue(out, "avgFreedMemoryByGC", formed.getValue(), formed.getUnits() + "/coll");
      formed = sigmaMemoryFormat(model.getFreedMemoryByGC().standardDeviation());
      exportValue(out, "avgFreedMemoryByGC\u03c3", formed.getValue(), formed.getUnits() + "/coll");
      exportValue(out, "avgFreedMemoryByGCisSig", isSignificant(model.getFreedMemoryByGC().average(),
          model.getFreedMemoryByGC().standardDeviation()));
    }
    formed = footprintFormatter.formatToFormatted(model.getFreedMemory());
    exportValue(out, "freedMemory", formed.getValue(), formed.getUnits());
  }
View Full Code Here

TOP

Related Classes of com.tagtraum.perf.gcviewer.util.FormattedValue

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.