All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.commons.stat.SimpleStat Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.commons.stat;


/**
 * A simple statistic recorder that computes the average, minimum and maximum value observed.
 *
 * @author Pedro Ruivo
 * @since 10.0
 */
public interface SimpleStat {

   SimpleStat EMPTY = new SimpleStat() {
   };

   default void record(long value) {
   }

   default long getMin(long defaultValue) {
      return defaultValue;
   }

   default long getMax(long defaultValue) {
      return defaultValue;
   }

   default long getAverage(long defaultValue) {
      return defaultValue;
   }

   default long count() {
      return 0;
   }

   default boolean isEmpty() {
      return count() == 0;
   }

   default void setTimer(TimerTracker timer) {
   }

   default void reset() {
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy