Top Description Fields Constructors Methods
net.sf.ehcache.statistics.beans

public Class ExtendedStatisticsMBean

extends ProxiedDynamicMBean
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException, .Method, java.util.Collections, .LinkedList, .List, .Map, .TreeMap, java.util.concurrent.TimeUnit, net.sf.ehcache.Ehcache, net.sf.ehcache.statistics.extended.ExtendedStatistics, .ExtendedStatistics.Operation, .ExtendedStatistics.Result, .ExtendedStatistics.Statistic, org.slf4j.Logger, .LoggerFactory, org.terracotta.statistics.ValueStatistic, org.terracotta.statistics.archive.Timestamped

A dynamically built mbean based on the available statistics for a cache.
Author
cschanck

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public
ExtendedStatisticsMBean(Ehcache
the cache
cache
,
ExtendedStatistics
the extended statistics
extendedStatistics
)

Instantiates a new extended statistics m bean.

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

the string
divineName
(Ehcache
the cache
cache
)

Divine the name.

private void
extractAttributes(ExtendedStatistics extendedStatistics, List<AttributeProxy<T>> proxies, Method m)

protected Map<K, V>

Returns:

the map
historyToMapDouble
(List<Timestamped<Double>>
the history
history
)

History to map double.

protected Map<K, V>

Returns:

the map
historyToMapLong
(List<Timestamped<Long>>
the history
history
)

History to map long.

private void
processMethods(ExtendedStatistics extendedStatistics, List<AttributeProxy<T>> proxies)

public void
recordDoubleStatistic(List<AttributeProxy<T>>
the proxies
proxies
,
String
the longer name
longerName
,
String
the base description
baseDescription
,
final ExtendedStatistics.Statistic<Double>
the stat
stat
)

Record double statistic.

public void
recordLongStatistic(List<AttributeProxy<T>>
the proxies
proxies
,
String
the longer name
longerName
,
String
the base description
baseDescription
,
final ExtendedStatistics.Statistic<Long>
the stat
stat
)

Record long statistic.

private void
recordOperation(List<AttributeProxy<T>> proxies, ExtendedStatistics extendedStatistics, String name, final ExtendedStatistics.Operation<T extends Enum<T>> op)

private void
recordResult(List<AttributeProxy<T>> proxies, final ExtendedStatistics.Result result, String longerName)

private void
private void
recordValueStatistic(List<AttributeProxy<T>> proxies, final ValueStatistic<T extends Number> stat, String prefix, Method m)

Inherited from net.sf.ehcache.statistics.beans.ProxiedDynamicMBean:
getAttributegetAttributesgetBeanNamegetMBeanInfoinitializeinvokesetAttributesetAttributes

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

ExtendedStatisticsMBeanback to summary
public ExtendedStatisticsMBean(Ehcache cache, ExtendedStatistics extendedStatistics)

Instantiates a new extended statistics m bean.

Parameters
cache:Ehcache

the cache

extendedStatistics:ExtendedStatistics

the extended statistics

Method Detail

divineNameback to summary
public static String divineName(Ehcache cache)

Divine the name.

Parameters
cache:Ehcache

the cache

Returns:String

the string

extractAttributesback to summary
private void extractAttributes(ExtendedStatistics extendedStatistics, List<AttributeProxy<T>> proxies, Method m) throws IllegalAccessException, InvocationTargetException
historyToMapDoubleback to summary
protected Map<K, V> historyToMapDouble(List<Timestamped<Double>> history)

History to map double.

Parameters
history:List<Timestamped<Double>>

the history

Returns:Map<K, V>

the map

historyToMapLongback to summary
protected Map<K, V> historyToMapLong(List<Timestamped<Long>> history)

History to map long.

Parameters
history:List<Timestamped<Long>>

the history

Returns:Map<K, V>

the map

processMethodsback to summary
private void processMethods(ExtendedStatistics extendedStatistics, List<AttributeProxy<T>> proxies)
recordDoubleStatisticback to summary
public void recordDoubleStatistic(List<AttributeProxy<T>> proxies, String longerName, String baseDescription, final ExtendedStatistics.Statistic<Double> stat)

Record double statistic.

Parameters
proxies:List<AttributeProxy<T>>

the proxies

longerName:String

the longer name

baseDescription:String

the base description

stat:ExtendedStatistics.Statistic<Double>

the stat

recordLongStatisticback to summary
public void recordLongStatistic(List<AttributeProxy<T>> proxies, String longerName, String baseDescription, final ExtendedStatistics.Statistic<Long> stat)

Record long statistic.

Parameters
proxies:List<AttributeProxy<T>>

the proxies

longerName:String

the longer name

baseDescription:String

the base description

stat:ExtendedStatistics.Statistic<Long>

the stat

recordOperationback to summary
private void recordOperation(List<AttributeProxy<T>> proxies, ExtendedStatistics extendedStatistics, String name, final ExtendedStatistics.Operation<T extends Enum<T>> op)
recordResultback to summary
private void recordResult(List<AttributeProxy<T>> proxies, final ExtendedStatistics.Result result, String longerName)
recordStatisticback to summary
private void recordStatistic(List<AttributeProxy<T>> proxies, final ExtendedStatistics.Statistic<Number> stat, String prefix, Method m)
recordValueStatisticback to summary
private void recordValueStatistic(List<AttributeProxy<T>> proxies, final ValueStatistic<T extends Number> stat, String prefix, Method m)