Class RateImpl<T extends java.lang.Enum<T>>

  • Type Parameters:
    T - the generic type
    All Implemented Interfaces:
    ExtendedStatistics.Statistic<java.lang.Double>

    public class RateImpl<T extends java.lang.Enum<T>>
    extends java.lang.Object
    implements ExtendedStatistics.Statistic<java.lang.Double>
    The Class RateStatistic.
    Author:
    cdennis
    • Constructor Summary

      Constructors 
      Constructor Description
      RateImpl​(org.terracotta.statistics.SourceStatistic<org.terracotta.statistics.observer.ChainedOperationObserver<T>> source, java.util.Set<T> targets, long averageNanos, java.util.concurrent.ScheduledExecutorService executor, int historySize, long historyNanos)
      Instantiates a new rate statistic.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean active()
      Active.
      protected boolean expire​(long expiry)
      Check the statistic for expiry.
      java.util.List<org.terracotta.statistics.archive.Timestamped<java.lang.Double>> history()
      History.
      protected void setHistory​(int historySize, long historyNanos)
      Set the sample history parameters.
      protected void setWindow​(long averageNanos)
      Sets the window.
      protected void start()
      Start sampling.
      java.lang.Double value()
      Value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RateImpl

        public RateImpl​(org.terracotta.statistics.SourceStatistic<org.terracotta.statistics.observer.ChainedOperationObserver<T>> source,
                        java.util.Set<T> targets,
                        long averageNanos,
                        java.util.concurrent.ScheduledExecutorService executor,
                        int historySize,
                        long historyNanos)
        Instantiates a new rate statistic.
        Parameters:
        targets - the targets
        averageNanos - the average nanos
        executor - the executor
        historySize - the history size
        historyNanos - the history nanos
    • Method Detail

      • start

        protected void start()
        Start sampling.
      • setWindow

        protected void setWindow​(long averageNanos)
        Sets the window.
        Parameters:
        averageNanos - the new window
      • setHistory

        protected void setHistory​(int historySize,
                                  long historyNanos)
        Set the sample history parameters.
        Parameters:
        historySize - history sample size
        historyNanos - history sample period
      • expire

        protected boolean expire​(long expiry)
        Check the statistic for expiry.
        Parameters:
        expiry - expiry threshold
        Returns:
        true if expired