com.cloudtran.util
Class ResourceLevel

java.lang.Object
  extended by com.cloudtran.util.ResourceLevel

public class ResourceLevel
extends Object

When OpTimer2 is enabled, this pumps out usage levels of resources after each OpTimer2 block. The layout of a line in the report is Flag CodeName Value Description. The 'Flag' is ++ if the last value is greater than the last 10 previous values ++** if the value is monotonically increasing and is now greater than the last 10 previous values If the last value returned for a resource level is null, or the value has not changed for the last 5 values, it is not reported.


Nested Class Summary
static class ResourceLevel.AtomicIntegerResourceLevel
           
static class ResourceLevel.AtomicLongResourceLevel
           
static class ResourceLevel.MapResourceLevel
           
static class ResourceLevel.QueueResourceLevel
           
static class ResourceLevel.ResourceLevelProviderBase
           
 
Field Summary
static int NVALUES_FOR_DISPLAYCHECK
           
static int NVALUES_FOR_MONOTONIC
           
 
Constructor Summary
ResourceLevel()
           
 
Method Summary
static void addAtomicIntegerResourceLevel(String codeName, String description, AtomicInteger atomicInteger)
           
static void addAtomicLongResourceLevel(String codeName, String description, AtomicLong atomicLong)
           
static void addMapResourceLevel(String codeName, String description, Map map)
           
static void addNewResourceLevelObject(com.cloudtran.util.ResourceLevel.ResourceLevelProvider resourceLevelProvider)
           
static void addQueueResourceLevel(String codeName, String description, LinkedBlockingQueue q)
           
static String getResourceLevelsNow()
          Called from OpTimer2 to dump out all the OpTimers worth displaying.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NVALUES_FOR_MONOTONIC

public static final int NVALUES_FOR_MONOTONIC
See Also:
Constant Field Values

NVALUES_FOR_DISPLAYCHECK

public static final int NVALUES_FOR_DISPLAYCHECK
See Also:
Constant Field Values
Constructor Detail

ResourceLevel

public ResourceLevel()
Method Detail

addNewResourceLevelObject

public static void addNewResourceLevelObject(com.cloudtran.util.ResourceLevel.ResourceLevelProvider resourceLevelProvider)

addAtomicLongResourceLevel

public static void addAtomicLongResourceLevel(String codeName,
                                              String description,
                                              AtomicLong atomicLong)

addAtomicIntegerResourceLevel

public static void addAtomicIntegerResourceLevel(String codeName,
                                                 String description,
                                                 AtomicInteger atomicInteger)

addMapResourceLevel

public static void addMapResourceLevel(String codeName,
                                       String description,
                                       Map map)

addQueueResourceLevel

public static void addQueueResourceLevel(String codeName,
                                         String description,
                                         LinkedBlockingQueue q)

getResourceLevelsNow

public static String getResourceLevelsNow()
Called from OpTimer2 to dump out all the OpTimers worth displaying. This is synchronized because we reset all the resourceLevel values. If there are no resources levels worth showing, the return value is null. For a given line, no value is shown if the value has been the same for the last NVALUES_FOR_DISPLAYCHECK entries. Normally all trace is disabled in this because it fills up a lot of logs (especially overnight).