ariba.util.core
Class PerformanceState

java.lang.Object
  extended by ariba.util.core.PerformanceState

public class PerformanceState
extends Object

This class maintains performance state for the current thread. It can be considered a specialized extension to ThreadDebugState (and, in fact, stores itself there).


Nested Class Summary
static class PerformanceState.Stats
           
 
Field Summary
static PerformanceStateTimedCounter DispatchTimer
           
static String Status_Cancel
           
static String Status_InternalError
           
static String Status_Refresh
           
static String Status_StoppedWaiting
           
static String Status_Success
           
static String Status_Timeout
           
static String Status_ValidationError
           
static String Type_Call
           
static String Type_Task
           
static String Type_User
           
static String Type_Work
           
 
Constructor Summary
PerformanceState()
           
 
Method Summary
static void addObserver(PerformanceStateCore.MetricObserver observer)
           
static void archiveLogFile()
           
static void clear()
          Deprecated. Use ThreadDebugState.clear()
static String fileHeaderString()
           
static String getNodeName()
           
static PerformanceState.Stats getThisThreadHashtable()
          If you need direct access to the hashtable, you can get it this way.
static boolean isLoggingEnabled()
           
static PerformanceStateCore[] logMetrics()
          Returns an array of the PerformanceStateCore objects to be used in logging.
static void logToFile(PerformanceState.Stats stats)
           
static void registrationComplete()
          Must be called by app after all metrics have been registered.
static void restoreContinuedHashtable(PerformanceState.Stats stats)
           
static void setNodeName(String nodeName)
          Must be initialized by server prior to first log event
static void setPerformanceCheck(PerformanceCheck check)
           
static void setStatus(String status)
           
static boolean threadStateEnabled()
           
 String toString()
           
static void watchPerformance(PerformanceCheck checker)
          Set a thread to have its execution time monitored.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DispatchTimer

public static PerformanceStateTimedCounter DispatchTimer

Type_User

public static final String Type_User
See Also:
Constant Field Values

Type_Task

public static final String Type_Task
See Also:
Constant Field Values

Type_Work

public static final String Type_Work
See Also:
Constant Field Values

Type_Call

public static final String Type_Call
See Also:
Constant Field Values

Status_Success

public static final String Status_Success
See Also:
Constant Field Values

Status_InternalError

public static final String Status_InternalError
See Also:
Constant Field Values

Status_ValidationError

public static final String Status_ValidationError
See Also:
Constant Field Values

Status_Timeout

public static final String Status_Timeout
See Also:
Constant Field Values

Status_StoppedWaiting

public static final String Status_StoppedWaiting
See Also:
Constant Field Values

Status_Refresh

public static final String Status_Refresh
See Also:
Constant Field Values

Status_Cancel

public static final String Status_Cancel
See Also:
Constant Field Values
Constructor Detail

PerformanceState

public PerformanceState()
Method Detail

registrationComplete

public static void registrationComplete()
Must be called by app after all metrics have been registered. At that point logging can begin (and no further registration should be performed)


threadStateEnabled

public static final boolean threadStateEnabled()

isLoggingEnabled

public static boolean isLoggingEnabled()

clear

public static void clear()
Deprecated. Use ThreadDebugState.clear()

Remove all values that are currently stored.


watchPerformance

public static void watchPerformance(PerformanceCheck checker)
Set a thread to have its execution time monitored. If clear() has not been called for this thread before the errorDuration has passed, then the thread debug state will be written to the error log.

Parameters:
checker - -- the performance check object. It's warningTimeMillis determines the logging period

setPerformanceCheck

public static void setPerformanceCheck(PerformanceCheck check)

addObserver

public static void addObserver(PerformanceStateCore.MetricObserver observer)

toString

public String toString()
Overrides:
toString in class Object

getThisThreadHashtable

public static PerformanceState.Stats getThisThreadHashtable()
If you need direct access to the hashtable, you can get it this way. If you intend to save the object for later use (past the bounds of the current ui boundary, you should call clone on the data so that when this object is cleared, your shared copy of the hashtable is not also cleared.


restoreContinuedHashtable

public static void restoreContinuedHashtable(PerformanceState.Stats stats)

setStatus

public static void setStatus(String status)

setNodeName

public static void setNodeName(String nodeName)
Must be initialized by server prior to first log event


getNodeName

public static String getNodeName()

logMetrics

public static PerformanceStateCore[] logMetrics()
Returns an array of the PerformanceStateCore objects to be used in logging.


fileHeaderString

public static String fileHeaderString()

logToFile

public static void logToFile(PerformanceState.Stats stats)

archiveLogFile

public static void archiveLogFile()


AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.