Class CacheStatisticCollector


  • public class CacheStatisticCollector
    extends java.lang.Object
    Collects and maintains all the statistics for a cache.
    Since:
    6.0
    Author:
    Roberto Palmieri, Sebastiano Peluso, Diego Didona, Pedro Ruivo
    • Constructor Detail

      • CacheStatisticCollector

        public CacheStatisticCollector​(TimeService timeService)
    • Method Detail

      • reset

        public final void reset()
        reset all the statistics collected so far.
      • merge

        public final void merge​(TransactionStatistics transactionStatistics)
        Merges a transaction statistics in this cache statistics.
      • addLocalValue

        public final void addLocalValue​(ExtendedStatistic stat,
                                        double value)
        Adds a value to a local statistic. This value is not associated with any transaction.
      • addRemoteValue

        public final void addRemoteValue​(ExtendedStatistic stat,
                                         double value)
        Adds a value to a remote statistic. This value is not associated with any transaction.
      • getPercentile

        public final double getPercentile​(PercentileStatistic stat,
                                          int percentile)
                                   throws java.lang.IllegalArgumentException
        Returns:
        the percentile og the statistic.
        Throws:
        java.lang.IllegalArgumentException - if the percentile request is not in the correct bounds (]0,100[)
      • dumpTo

        public final void dumpTo​(java.lang.StringBuilder builder)
        Dumps all the cache statistic values to a StringBuilder
      • dumpTo

        public final void dumpTo​(java.io.PrintWriter writer)
        Prints the cache statistics values to a PrintStream.
      • convertNanosToMicro

        public static double convertNanosToMicro​(double nanos)
        Returns:
        the conversion of nanoseconds to microseconds without losing precision.
      • convertNanosToSeconds

        public static double convertNanosToSeconds​(double nanos)
        Returns:
        the conversion of nanoseconds to seconds without losing precision.