ariba.util.core
Class PerformanceStateCore

java.lang.Object
  extended by ariba.util.core.PerformanceStateCore
Direct Known Subclasses:
PerformanceStateCounter

public abstract class PerformanceStateCore
extends java.lang.Object

This class is the root for performance counters. Using them is as simple as can possibly be.

For example if you wanted to track how many cluster reconstitutes there were:

    private static final ClusterRootReconstitutes =
        new PerformanceStateCounter("Cluster Root Reconstitutes");
    

...

        ClusterRootReconstitutes.addCount();
    

You can (and should) declare the counter as a static object. But whenever it is used, the statistics are recorded and saved on a per thread basis.

The implementation of perf state objects is split into two peices: the static "handle" used by clients, and an inner class (called Instance) that actually stores the data. The methods on the outer class provide a convenience for accessing common operations. One can always "reach through" to the underlying per-thread instance to access the full API. For instance: ClusterRootReconstitutes.addCount(); is a convenience for: ((PerformanceStateCounter.Instance)ClusterRootReconstitutes.Instance()).addCount();


Nested Class Summary
static class PerformanceStateCore.EventDetail
           
static class PerformanceStateCore.Instance
          the real data bearing instance
static interface PerformanceStateCore.MetricObserver
           
 
Field Summary
static int LOG_COUNT
           
static int LOG_EVENTS
           
static int LOG_TIME
           
static java.util.Comparator LogRankComparator
          Is a Comparator that compares PerformanceStateCores on the basis of their log ranks.
 
Constructor Summary
PerformanceStateCore(java.lang.String name)
           
PerformanceStateCore(java.lang.String name, int logRank)
           
PerformanceStateCore(java.lang.String name, int logRank, int logFlags)
          Create a performance counter with the given name.
 
Method Summary
 void appendCSVData(FormatBuffer buf, PerformanceState.Stats stats)
           
 void appendCSVHeaders(FormatBuffer buf)
           
static int getGlobalStackTraceCaptureThreshold()
          The number of events with a given signature before we capture a backtrace in the EventDetail
 int getLogRank()
           
 java.lang.String getName()
          Returns the name for this performace state object.
 boolean hasSameNameAs(PerformanceStateCore that)
          Returns whether this has the same name as that.
 PerformanceStateCore.Instance instance()
          Not a static method, but it returns the object to be used as a "this" on operations much the way static methods are used to return a singelton.
static void setGlobalStackTraceCaptureThreshold(int count)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_COUNT

public static final int LOG_COUNT
See Also:
Constant Field Values

LOG_TIME

public static final int LOG_TIME
See Also:
Constant Field Values

LOG_EVENTS

public static final int LOG_EVENTS
See Also:
Constant Field Values

LogRankComparator

public static final java.util.Comparator LogRankComparator
Is a Comparator that compares PerformanceStateCores on the basis of their log ranks.

Constructor Detail

PerformanceStateCore

public PerformanceStateCore(java.lang.String name,
                            int logRank,
                            int logFlags)
Create a performance counter with the given name. If logRank > 0, then metric will be logged (and rank specifies column order)


PerformanceStateCore

public PerformanceStateCore(java.lang.String name,
                            int logRank)

PerformanceStateCore

public PerformanceStateCore(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Returns the name for this performace state object.


hasSameNameAs

public boolean hasSameNameAs(PerformanceStateCore that)
Returns whether this has the same name as that.


getLogRank

public int getLogRank()

appendCSVData

public void appendCSVData(FormatBuffer buf,
                          PerformanceState.Stats stats)

appendCSVHeaders

public void appendCSVHeaders(FormatBuffer buf)

instance

public PerformanceStateCore.Instance instance()
Not a static method, but it returns the object to be used as a "this" on operations much the way static methods are used to return a singelton.


getGlobalStackTraceCaptureThreshold

public static int getGlobalStackTraceCaptureThreshold()
The number of events with a given signature before we capture a backtrace in the EventDetail


setGlobalStackTraceCaptureThreshold

public static void setGlobalStackTraceCaptureThreshold(int count)


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