Class RollingOnDemandStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>

  • 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.Inspectable
    This 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.
    • 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 id
        aCategory - a category
        aSubsystem - a subsystem
        aStatsFactory - 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 id
        aCategory - a category
        aSubsystem - a subsystem
        aStatsFactory - 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:
        getCategory in interface net.anotheria.moskito.core.producers.IStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
      • getProducerId

        public java.lang.String getProducerId()
        Specified by:
        getProducerId in interface net.anotheria.moskito.core.producers.IStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
      • getStats

        public java.util.List<S> getStats()
        Specified by:
        getStats in interface net.anotheria.moskito.core.producers.IStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
      • getSubsystem

        public java.lang.String getSubsystem()
        Specified by:
        getSubsystem in interface net.anotheria.moskito.core.producers.IStatsProducer<S extends net.anotheria.moskito.core.producers.IStats>
      • getDefaultStats

        public S getDefaultStats()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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:
        getCreationInfo in interface net.anotheria.moskito.core.inspection.Inspectable
        Returns: