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

com.github.marschall.micrometer.jfr.LongStatisticsFactory Maven / Gradle / Ivy

The newest version!
package com.github.marschall.micrometer.jfr;

@FunctionalInterface
interface LongStatisticsFactory {

  LongStatistics newLongStatistics();

  static LongStatisticsFactory newInstance(StatisticsMode mode) {
    switch (mode) {
    case NONE:
      return () -> NullLongStatistics.INSTANCE;
    case MEMORY:
      return FieldUpdaterLongStatistics::new;
    case CONCURRENCY:
      return AtomicLongStatistics::new;
    default:
      throw new IncompatibleClassChangeError("unknown enum value: " + mode);
    }
  }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy