polyglot.frontend
Class Stats

java.lang.Object
  extended by polyglot.frontend.Stats

public class Stats
extends java.lang.Object

Statistics collection and reporting object. Extensions can override this to collect more stats or to change reporting.


Nested Class Summary
protected static class Stats.Times
           
 
Field Summary
protected  ExtensionInfo ext
          Extension we're collecting stats for.
protected  java.util.List keys
          List of Objects used as keys to passTimes.
protected  java.util.Map passTimes
          Map from Objects to pair of inclusive and exclusive times.
 
Constructor Summary
Stats(ExtensionInfo ext)
           
 
Method Summary
 void accumPassTimes(java.lang.Object key, long in, long ex)
          Accumulate inclusive and exclusive times for a pass.
 long passTime(java.lang.Object key, boolean inclusive)
          Return the accumulated times for a pass.
 void report()
          Report the stats.
 void resetPassTimes(java.lang.Object key)
          Reset the accumulated times for a pass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ext

protected ExtensionInfo ext
Extension we're collecting stats for.


passTimes

protected java.util.Map passTimes
Map from Objects to pair of inclusive and exclusive times.


keys

protected java.util.List keys
List of Objects used as keys to passTimes. We have an explicit list in order to report the keys in order.

Constructor Detail

Stats

public Stats(ExtensionInfo ext)
Method Detail

resetPassTimes

public void resetPassTimes(java.lang.Object key)
Reset the accumulated times for a pass.


passTime

public long passTime(java.lang.Object key,
                     boolean inclusive)
Return the accumulated times for a pass.


accumPassTimes

public void accumPassTimes(java.lang.Object key,
                           long in,
                           long ex)
Accumulate inclusive and exclusive times for a pass.


report

public void report()
Report the stats.