ehcache

net.sf.ehcache.statistics.beans
Class ExtendedStatisticsMBean

java.lang.Object
  extended by net.sf.ehcache.statistics.beans.ProxiedDynamicMBean
      extended by net.sf.ehcache.statistics.beans.ExtendedStatisticsMBean
All Implemented Interfaces:
DynamicMBean

public class ExtendedStatisticsMBean
extends ProxiedDynamicMBean

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

Author:
cschanck

Constructor Summary
ExtendedStatisticsMBean(Ehcache cache, ExtendedStatistics extendedStatistics)
          Instantiates a new extended statistics m bean.
 
Method Summary
static String divineName(Ehcache cache)
          Divine the name.
protected  Map historyToMapDouble(List<org.terracotta.statistics.archive.Timestamped<Double>> history)
          History to map double.
protected  Map historyToMapLong(List<org.terracotta.statistics.archive.Timestamped<Long>> history)
          History to map long.
 void recordDoubleStatistic(List<AttributeProxy> proxies, String longerName, String baseDescription, ExtendedStatistics.Statistic<Double> stat)
          Record double statistic.
 void recordLongStatistic(List<AttributeProxy> proxies, String longerName, String baseDescription, ExtendedStatistics.Statistic<Long> stat)
          Record long statistic.
 
Methods inherited from class net.sf.ehcache.statistics.beans.ProxiedDynamicMBean
getAttribute, getAttributes, getBeanName, getMBeanInfo, initialize, invoke, setAttribute, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedStatisticsMBean

public ExtendedStatisticsMBean(Ehcache cache,
                               ExtendedStatistics extendedStatistics)
Instantiates a new extended statistics m bean.

Parameters:
cache - the cache
extendedStatistics - the extended statistics
Method Detail

recordDoubleStatistic

public void recordDoubleStatistic(List<AttributeProxy> proxies,
                                  String longerName,
                                  String baseDescription,
                                  ExtendedStatistics.Statistic<Double> stat)
Record double statistic.

Parameters:
proxies - the proxies
longerName - the longer name
baseDescription - the base description
stat - the stat

recordLongStatistic

public void recordLongStatistic(List<AttributeProxy> proxies,
                                String longerName,
                                String baseDescription,
                                ExtendedStatistics.Statistic<Long> stat)
Record long statistic.

Parameters:
proxies - the proxies
longerName - the longer name
baseDescription - the base description
stat - the stat

historyToMapLong

protected Map historyToMapLong(List<org.terracotta.statistics.archive.Timestamped<Long>> history)
History to map long.

Parameters:
history - the history
Returns:
the map

historyToMapDouble

protected Map historyToMapDouble(List<org.terracotta.statistics.archive.Timestamped<Double>> history)
History to map double.

Parameters:
history - the history
Returns:
the map

divineName

public static String divineName(Ehcache cache)
Divine the name.

Parameters:
cache - the cache
Returns:
the string

ehcache

Copyright 2001-2014, Terracotta, Inc.