Class RollingOnDemandStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
- java.lang.Object
-
- net.anotheria.moskito.extensions.producers.RollingOnDemandStatsProducer<S>
-
- All Implemented Interfaces:
net.anotheria.moskito.core.inspection.Inspectable,net.anotheria.moskito.core.producers.IStatsProducer<S>
public class RollingOnDemandStatsProducer<S extends net.anotheria.moskito.core.producers.IStats> extends java.lang.Object implements net.anotheria.moskito.core.producers.IStatsProducer<S>, net.anotheria.moskito.core.inspection.InspectableThis producer is used as a an alternative to OnDemandStatsProducer with a max limit count based on LRU strategy. It uses com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap internally.- Author:
- lrosenberg, ubeinges
-
-
Constructor Summary
Constructors Constructor Description RollingOnDemandStatsProducer(java.lang.String aProducerId, java.lang.String aCategory, java.lang.String aSubsystem, net.anotheria.moskito.core.dynamic.IOnDemandStatsFactory<S> aStatsFactory, int maxEntries)Creates a new OnDemandStatsProducer instance.RollingOnDemandStatsProducer(java.lang.String aProducerId, java.lang.String aCategory, java.lang.String aSubsystem, net.anotheria.moskito.core.dynamic.IOnDemandStatsFactory<S> aStatsFactory, int minEntries, int maxEntries, int concurrencyLevel)Creates a new OnDemandStatsProducer instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<S>getCachedStatsList()java.lang.StringgetCategory()net.anotheria.moskito.core.inspection.CreationInfogetCreationInfo()Returns the creation info about a producer.SgetDefaultStats()java.lang.StringgetProducerId()java.util.List<S>getStats()SgetStats(java.lang.String name)java.lang.StringgetSubsystem()java.lang.StringtoString()
-
-
-
Constructor Detail
-
RollingOnDemandStatsProducer
public RollingOnDemandStatsProducer(java.lang.String aProducerId, java.lang.String aCategory, java.lang.String aSubsystem, net.anotheria.moskito.core.dynamic.IOnDemandStatsFactory<S> aStatsFactory, int maxEntries)Creates a new OnDemandStatsProducer instance.- Parameters:
aProducerId- a producer idaCategory- a categoryaSubsystem- a subsystemaStatsFactory- a factory for IStat object creation.maxEntries- max amount of allowed entries.
-
RollingOnDemandStatsProducer
public RollingOnDemandStatsProducer(java.lang.String aProducerId, java.lang.String aCategory, java.lang.String aSubsystem, net.anotheria.moskito.core.dynamic.IOnDemandStatsFactory<S> aStatsFactory, int minEntries, int maxEntries, int concurrencyLevel)Creates a new OnDemandStatsProducer instance.- Parameters:
aProducerId- a producer idaCategory- a categoryaSubsystem- a subsystemaStatsFactory- a factory for IStat object creation.minEntries- starting amount of allowed entries.maxEntries- max amount of allowed entries.concurrencyLevel- concurrency level of the underlying ConcurrentLinkedHashMap.
-
-
Method Detail
-
getStats
public S getStats(java.lang.String name)
-
getCategory
public java.lang.String getCategory()
- Specified by:
getCategoryin interfacenet.anotheria.moskito.core.producers.IStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
-
getProducerId
public java.lang.String getProducerId()
- Specified by:
getProducerIdin interfacenet.anotheria.moskito.core.producers.IStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
-
getStats
public java.util.List<S> getStats()
- Specified by:
getStatsin interfacenet.anotheria.moskito.core.producers.IStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
-
getSubsystem
public java.lang.String getSubsystem()
- Specified by:
getSubsystemin interfacenet.anotheria.moskito.core.producers.IStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
-
getDefaultStats
public S getDefaultStats()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getCachedStatsList
protected java.util.List<S> getCachedStatsList()
-
getCreationInfo
public net.anotheria.moskito.core.inspection.CreationInfo getCreationInfo()
Returns the creation info about a producer.- Specified by:
getCreationInfoin interfacenet.anotheria.moskito.core.inspection.Inspectable- Returns:
-
-