|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.perf4j.helpers.StatisticsExposingMBean
public class StatisticsExposingMBean
This class provides a wrapper around GroupedTimingStatistics data so that this performance information can be exposed through JMX.
Field Summary | |
---|---|
protected java.util.regex.Pattern |
attributeNamePattern
Pattern used to parse requested attribute names into the tag name and the statistic name |
protected GroupedTimingStatistics |
currentTimingStatistics
The current underlying timing statistics whose values are exposed as MBean attributes. |
static java.lang.String |
DEFAULT_MBEAN_NAME
Logging classes use this as the default ObjectName of this MBean when registering it with an MBeanServer. |
protected javax.management.MBeanInfo |
managementInterface
This MBeanInfo exposes this MBean's management interface to the MBeanServer. |
Constructor Summary | |
---|---|
StatisticsExposingMBean(java.util.Collection<java.lang.String> tagsToExpose)
Creates a new StatisticsExposingMBean whose management interface exposes performance attributes for the tags specified. |
Method Summary | |
---|---|
protected javax.management.MBeanInfo |
createMBeanInfoFromTagNames(java.util.Collection<java.lang.String> tagNames)
Helper method creates an MBeanInfo object that contains 6 read only attributes for each tag name, each attribute representing a different statistic. |
java.lang.Object |
getAttribute(java.lang.String attribute)
|
javax.management.AttributeList |
getAttributes(java.lang.String[] attributeNames)
|
javax.management.MBeanInfo |
getMBeanInfo()
|
protected java.util.Map<java.lang.String,StatsValueRetriever> |
getStatsValueRetrievers()
Overridable helper method gets the Map of statistic name to StatsValueRetriever. |
java.lang.Object |
invoke(java.lang.String s,
java.lang.Object[] objects,
java.lang.String[] strings)
|
void |
setAttribute(javax.management.Attribute attribute)
|
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attributes)
|
void |
updateCurrentTimingStatistics(GroupedTimingStatistics currentTimingStatistics)
This method should be called to update the underlying timing statistics, which will correspondingly change the values of the exposed attributes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_MBEAN_NAME
protected javax.management.MBeanInfo managementInterface
protected GroupedTimingStatistics currentTimingStatistics
protected java.util.regex.Pattern attributeNamePattern
Constructor Detail |
---|
public StatisticsExposingMBean(java.util.Collection<java.lang.String> tagsToExpose)
tagsToExpose
- The names of the tags whose statistics should exposed. For each tag specified there will be
6 attributes whose getters are exposed: tagNameMean, tagNameStdDev, tagNameMin,
tagNameMax, and tagNameCount and tagNameTPSMethod Detail |
---|
public void updateCurrentTimingStatistics(GroupedTimingStatistics currentTimingStatistics)
currentTimingStatistics
- The TimingStatistics to set, may not be nullpublic java.lang.Object getAttribute(java.lang.String attribute) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
getAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
public void setAttribute(javax.management.Attribute attribute) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException
setAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.AttributeList getAttributes(java.lang.String[] attributeNames)
getAttributes
in interface javax.management.DynamicMBean
public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
setAttributes
in interface javax.management.DynamicMBean
public java.lang.Object invoke(java.lang.String s, java.lang.Object[] objects, java.lang.String[] strings) throws javax.management.MBeanException, javax.management.ReflectionException
invoke
in interface javax.management.DynamicMBean
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.MBeanInfo getMBeanInfo()
getMBeanInfo
in interface javax.management.DynamicMBean
protected java.util.Map<java.lang.String,StatsValueRetriever> getStatsValueRetrievers()
protected javax.management.MBeanInfo createMBeanInfoFromTagNames(java.util.Collection<java.lang.String> tagNames)
tagNames
- The name of the tags whose statistics should be exposed as MBeanAttributes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |