Class MetricSampler
java.lang.Object
net.minecraft.util.profiling.metrics.MetricSampler
- Direct Known Subclasses:
MetricsRegistry.AggregatedMetricSampler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static interface
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Runnable
private final MetricCategory
private double
private boolean
private final String
private final DoubleSupplier
(package private) final MetricSampler.ThresholdTest
private final io.netty.buffer.ByteBuf
private final io.netty.buffer.ByteBuf
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MetricSampler
(String pName, MetricCategory pCategory, DoubleSupplier pSampler, Runnable pBeforeTick, MetricSampler.ThresholdTest pThresholdTest) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> MetricSampler.MetricSamplerBuilder
<T> builder
(String pName, MetricCategory pCategory, ToDoubleFunction<T> pSampler, T pContext) static MetricSampler
create
(String pName, MetricCategory pCategory, DoubleSupplier pSampler) static <T> MetricSampler
create
(String pName, MetricCategory pCategory, T pContext, ToDoubleFunction<T> pSampler) boolean
getName()
(package private) DoubleSupplier
int
hashCode()
void
onEndTick
(int pTickTime) void
void
result()
boolean
private void
-
Field Details
-
name
-
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 pName, MetricCategory pCategory, DoubleSupplier pSampler, @Nullable Runnable pBeforeTick, @Nullable MetricSampler.ThresholdTest pThresholdTest)
-
-
Method Details
-
create
-
create
public static <T> MetricSampler create(String pName, MetricCategory pCategory, T pContext, ToDoubleFunction<T> pSampler) -
builder
public static <T> MetricSampler.MetricSamplerBuilder<T> builder(String pName, MetricCategory pCategory, ToDoubleFunction<T> pSampler, T pContext) -
onStartTick
public void onStartTick() -
onEndTick
public void onEndTick(int pTickTime) -
onFinished
public void onFinished() -
verifyRunning
private void verifyRunning() -
getSampler
DoubleSupplier getSampler() -
getName
-
getCategory
-
result
-
triggersThreshold
public boolean triggersThreshold() -
equals
-
hashCode
public int hashCode()
-