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 interfacestatic class - 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Runnableprivate final MetricCategoryprivate doubleprivate booleanprivate final Stringprivate final DoubleSupplier(package private) final MetricSampler.ThresholdTestprivate final io.netty.buffer.ByteBufprivate final io.netty.buffer.ByteBuf - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMetricSampler(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 MetricSamplercreate(String pName, MetricCategory pCategory, DoubleSupplier pSampler) static <T> MetricSamplercreate(String pName, MetricCategory pCategory, T pContext, ToDoubleFunction<T> pSampler) booleangetName()(package private) DoubleSupplierinthashCode()voidonEndTick(int pTickTime) voidvoidresult()booleanprivate 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() 
 -