com.github.marschall.micrometer.jfr.LongStatisticsFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micrometer-jfr Show documentation
Show all versions of micrometer-jfr Show documentation
A Micrometer meter registry that generates JFR events
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);
}
}
}