|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.utilint.StatGroup
public class StatGroup
The Stats infrastructure provides context for JE statistics. Each statistic has these attributes: - metadata - specifically, a name and description - each statistic is associated with a parent stat group, which itself has a name and description. - support for the StatsConfig.clear semantics - a way to print statistics in a user friendly way. To create a statistic variable, instantiate one of the concrete subclasses of Stat. Each concrete subclass should hold the methods that are needed to best set and display the value. For example, instead of using LongStat to hold a timestamp or LSN value, use TimestampStat or LSNStat. A Stat instance needs to specify a StatDefinition. There may be multiple Stat variables in different components that share a StatDefinition. They are differentiated when displayed by their parent StatGroup. Each Stat instance is associated with a StatGroup, which holds the collection of stats that belong to a given component. Each member of the StatGroup has a unique StatDefinition. StatGroups can be combined, in order to accumulate values. For example, the LockManager may have multiple lock tables. Each lock table keeps its own latch statistics. When LockStats are generated, the StatsGroup for each latch is collected and rolled up into a single StatGroup, using the addAll(StatGroup) method. The Stats infrastructure is for internal use only. Public API classes like EnvironmentStats, LockStats, etc, contain StatGroups. A call to retrieve stats is implementing by getting a clone of the StatGroups held by the components like the cleaner, the incompressor, the LockManager, etc. The public API classes provide getter methods that reach into the StatGroups to return the specific stat value. To add a statistic, create the Stat variable in the component where it is being used and associate it with a StatGroup. The Stat infrastruture does the rest of the work for plumbing that statistic up to the public API class. Each API class must provide a getter method to access the specific statistic. Currenly, this is done manually.
Constructor Summary | |
---|---|
StatGroup(String groupName,
String groupDescription)
|
Method Summary | |
---|---|
void |
addAll(StatGroup other)
Add all the stats from the other group into this group. |
void |
addToTipMap(Map<String,String> tips)
|
void |
clear()
Clear all stats in a StatGroup. |
StatGroup |
cloneGroup(boolean clear)
|
TransactionStats.Active[] |
getActiveTxnArray(StatDefinition definition)
|
Long |
getAtomicLong(StatDefinition definition)
|
boolean |
getBoolean(StatDefinition definition)
|
String |
getDescription()
|
int |
getInt(StatDefinition definition)
|
long |
getLong(StatDefinition definition)
|
long[] |
getLongArray(StatDefinition definition)
|
LongStat |
getLongStat(StatDefinition definition)
|
String |
getName()
|
String |
getString(StatDefinition definition)
|
(package private) void |
register(Stat<?> oneStat)
Add a stat to the group. |
String |
toString()
|
String |
toStringVerbose()
Includes the per-stat description in the output string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StatGroup(String groupName, String groupDescription)
Method Detail |
---|
void register(Stat<?> oneStat)
public void addAll(StatGroup other)
public void clear()
public String getName()
public String getDescription()
public StatGroup cloneGroup(boolean clear)
public int getInt(StatDefinition definition)
public LongStat getLongStat(StatDefinition definition)
public long getLong(StatDefinition definition)
public Long getAtomicLong(StatDefinition definition)
public TransactionStats.Active[] getActiveTxnArray(StatDefinition definition)
public long[] getLongArray(StatDefinition definition)
public boolean getBoolean(StatDefinition definition)
public String getString(StatDefinition definition)
public void addToTipMap(Map<String,String> tips)
public String toString()
toString
in class Object
public String toStringVerbose()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |