util
Class Statistics

java.lang.Object
  extended by util.Statistics
Direct Known Subclasses:
RuntimeStatistics, StackStatistics

public abstract class Statistics
extends Object

Abstract class for encapsulating statistics collected by the runtime system.


Constructor Summary
Statistics()
           
 
Method Summary
abstract  void dumpFull(PrintStream out)
          Prints the full results for the statistics.
abstract  void dumpSummary(PrintStream out)
          Prints a summary of the statistics.
abstract  void merge(Object other)
          Merge two of the same type of statistics together.
protected  void printFullHeader(PrintStream out, String header)
          Prints out appropriately formatted header for dumpFull(PrintStream) output.
protected  void printSummaryHeader(PrintStream out, String header)
          Prints out appropriately formatted for dumpSummary(PrintStream) output.
protected  float[] summarizeFloats(Collection<Float> list, int drop)
          Returns mean, min, max, and variance of a collection of floats.
protected  void summarizeFloats(PrintStream out, Collection<Float> list, int drop, String prefix)
          Prints out mean, min, max, and stdev of a collection of floats.
protected  void summarizeFloats(PrintStream out, Collection<Float> list, String prefix)
          Prints out mean, min, max, and stdev of a collection of floats.
protected  float[] summarizeInts(Collection<Integer> list, int drop)
          Returns mean, min, max, and variance of a collection of integers.
protected  void summarizeInts(PrintStream out, Collection<Integer> list, int drop, String prefix)
          Prints out mean, min, max, and stdev of a collection of integers.
protected  void summarizeInts(PrintStream out, Collection<Integer> list, String prefix)
          Prints out mean, min, max, and stdev of a collection of integers.
protected  float[] summarizeLongs(Collection<Long> list, int drop)
          Returns mean, min, max, and variance of a collection of longs.
protected  void summarizeLongs(PrintStream out, Collection<Long> list, int drop, String prefix)
          Prints out mean, min, max, and stdev of a collection of longs.
protected  void summarizeLongs(PrintStream out, Collection<Long> list, int drop, String prefix, boolean suppressNewline)
          Prints out mean, min, max, and stdev of a collection of longs.
protected  void summarizeLongs(PrintStream out, Collection<Long> list, String prefix)
          Prints out mean, min, max, and stdev of a collection of longs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statistics

public Statistics()
Method Detail

dumpSummary

public abstract void dumpSummary(PrintStream out)
Prints a summary of the statistics. The output should be short and, in most cases, at most one line long.

Parameters:
out - output stream

dumpFull

public abstract void dumpFull(PrintStream out)
Prints the full results for the statistics.

Parameters:
out - output stream

merge

public abstract void merge(Object other)
Merge two of the same type of statistics together. Used to aggregate statistics together.

Parameters:
other - another statistics object of the same type to be merged with

printFullHeader

protected final void printFullHeader(PrintStream out,
                                     String header)
Prints out appropriately formatted header for dumpFull(PrintStream) output.

Parameters:
out - output stream
header - header to print

printSummaryHeader

protected final void printSummaryHeader(PrintStream out,
                                        String header)
Prints out appropriately formatted for dumpSummary(PrintStream) output.

Parameters:
out -
header -

summarizeInts

protected final void summarizeInts(PrintStream out,
                                   Collection<Integer> list,
                                   String prefix)
Prints out mean, min, max, and stdev of a collection of integers.

Parameters:
out - output stream
list - collection of integers
prefix - string to prefix the output

summarizeInts

protected final void summarizeInts(PrintStream out,
                                   Collection<Integer> list,
                                   int drop,
                                   String prefix)
Prints out mean, min, max, and stdev of a collection of integers.

Parameters:
out - output stream
list - collection of integers
drop - exclude the first drop integers from the output
prefix - string to prefix the output

summarizeInts

protected final float[] summarizeInts(Collection<Integer> list,
                                      int drop)
Returns mean, min, max, and variance of a collection of integers. This method takes a drop parameter that drops the first N integers before computing the summary statistics.

Parameters:
list - collection of integers
drop - exclude the first drop integers from the results
Returns:
an array of {mean, min, max, variance, number of dropped integers}

summarizeLongs

protected final void summarizeLongs(PrintStream out,
                                    Collection<Long> list,
                                    String prefix)
Prints out mean, min, max, and stdev of a collection of longs.

Parameters:
out - output stream
list - collection of longs
prefix - string to prefix the output

summarizeLongs

protected final void summarizeLongs(PrintStream out,
                                    Collection<Long> list,
                                    int drop,
                                    String prefix)
Prints out mean, min, max, and stdev of a collection of longs.

Parameters:
out - output stream
list - collection of longs
drop - exclude the first drop longs from the output
prefix - string to prefix the output

summarizeLongs

protected final void summarizeLongs(PrintStream out,
                                    Collection<Long> list,
                                    int drop,
                                    String prefix,
                                    boolean suppressNewline)
Prints out mean, min, max, and stdev of a collection of longs.

Parameters:
out - output stream
list - collection of longs
drop - exclude the first drop longs from the output
prefix - string to prefix the output
newLine - suppress trailing newline

summarizeLongs

protected final float[] summarizeLongs(Collection<Long> list,
                                       int drop)
Returns mean, min, max, and variance of a collection of longs. This method takes a drop parameter that drops the first N longs before computing the summary statistics.

Parameters:
list - collection of longs
drop - exclude the first drop longs from the results
Returns:
an array of {mean, min, max, variance, number of dropped longs}

summarizeFloats

protected final void summarizeFloats(PrintStream out,
                                     Collection<Float> list,
                                     String prefix)
Prints out mean, min, max, and stdev of a collection of floats.

Parameters:
out - output stream
list - collection of floats
prefix - string to prefix the output

summarizeFloats

protected final void summarizeFloats(PrintStream out,
                                     Collection<Float> list,
                                     int drop,
                                     String prefix)
Prints out mean, min, max, and stdev of a collection of floats.

Parameters:
out - output stream
list - collection of floats
drop - exclude the first drop floats from the output
prefix - string to prefix the output

summarizeFloats

protected final float[] summarizeFloats(Collection<Float> list,
                                        int drop)
Returns mean, min, max, and variance of a collection of floats. This method takes a drop parameter that drops the first N floats before computing the summary statistics.

Parameters:
list - collection of floats
drop - exclude the first drop floats from the results
Returns:
an array of {mean, min, max, variance, number of dropped floats}