Class MetricSampler
java.lang.Object
net.minecraft.util.profiling.metrics.MetricSampler
- Direct Known Subclasses:
MetricsRegistry.AggregatedMetricSampler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic enumstatic interfacestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MetricCategoryprivate doubleprivate booleanprivate final Stringprivate final DoubleSupplierprivate final MetricSampler.SamplingPhase(package private) final @Nullable MetricSampler.ThresholdTestprivate final io.netty.buffer.ByteBufprivate final io.netty.buffer.ByteBuf -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMetricSampler(String name, MetricSampler.SamplingPhase samplingPhase, MetricCategory category, DoubleSupplier sampler, @Nullable Runnable beforeTick, @Nullable MetricSampler.ThresholdTest thresholdTest) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> MetricSampler.MetricSamplerBuilder<T> builder(String metricName, MetricCategory category, ToDoubleFunction<T> sampler, T context) static MetricSamplercreate(String name, MetricCategory category, DoubleSupplier sampler) static MetricSamplercreateExtractSampler(String name, MetricCategory category, DoubleSupplier sampler) booleangetName()inthashCode()voidonEndTick(int currentTick) voidvoidresult()booleanprivate void
-
Field Details
-
name
-
samplingPhase
-
category
-
sampler
-
ticks
private final io.netty.buffer.ByteBuf ticks -
values
private final io.netty.buffer.ByteBuf values -
isRunning
private volatile boolean isRunning -
beforeTick
-
thresholdTest
-
currentValue
private double currentValue
-
-
Constructor Details
-
MetricSampler
protected MetricSampler(String name, MetricSampler.SamplingPhase samplingPhase, MetricCategory category, DoubleSupplier sampler, @Nullable Runnable beforeTick, @Nullable MetricSampler.ThresholdTest thresholdTest)
-
-
Method Details
-
create
-
createExtractSampler
public static MetricSampler createExtractSampler(String name, MetricCategory category, DoubleSupplier sampler) -
builder
public static <T> MetricSampler.MetricSamplerBuilder<T> builder(String metricName, MetricCategory category, ToDoubleFunction<T> sampler, T context) -
onStartTick
public void onStartTick() -
onEndTick
public void onEndTick(int currentTick) -
onFinished
public void onFinished() -
verifyRunning
private void verifyRunning() -
getSampler
-
getName
-
samplingPhase
-
getCategory
-
result
-
triggersThreshold
public boolean triggersThreshold() -
equals
-
hashCode
-