org.erights.e.elib.debug
Class Profiler

java.lang.Object
  |
  +--org.erights.e.elib.debug.Profiler

public class Profiler
extends Object

Untamed: Accumulates static profile info.

XXX Security alert: mutable static state / covert channel.

Author:
Mark S. Miller

Field Summary
private  FlexMap myCounters
          Maps from profKeys (Strings or Scripts) to CallCounters
static Profiler THE_ONE
          Enabled:
 
Constructor Summary
private Profiler()
           
 
Method Summary
 void clearCallCounts()
          Enabled: XXX Security alert: covert channel?
 ConstList getCallCounts(double percentile)
          Enabled: XXX Security alert: covert channel?
 void printTime(double percentile)
          Enabled:
 CallCounter register(Object profKey)
          Enabled: Note that multiple registrations of the same profKey will share the same CallCounter -- this is on purpose.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THE_ONE

public static final Profiler THE_ONE
Enabled:


myCounters

private final FlexMap myCounters
Maps from profKeys (Strings or Scripts) to CallCounters

Constructor Detail

Profiler

private Profiler()
Method Detail

register

public CallCounter register(Object profKey)
Enabled: Note that multiple registrations of the same profKey will share the same CallCounter -- this is on purpose.

EMethodNode and Matcher use this my providing their printstring as the profKey, and pointing at the CallCounter. This means that multiple EMethodNodes with the same printstring will increment the same counters, and that the CallCounter object will not prevent these EMethodNodes from being garbage collected. A dynamic number of EMethodNodes with a static number of names will still only cause a static number of CallCounters to be allocated.

Should we start using multiple Java ClassLoaders, then we probably want to change JavaMemberNode and OverloaderNode to use the same trick.


clearCallCounts

public void clearCallCounts()
Enabled: XXX Security alert: covert channel?


getCallCounts

public ConstList getCallCounts(double percentile)
Enabled: XXX Security alert: covert channel?

XXX TODO: Add a query for interface coverage checking.


printTime

public void printTime(double percentile)
Enabled:



comments?