Class ActiveMetricsRecorder
java.lang.Object
net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder
- All Implemented Interfaces:
MetricsRecorder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final longprivate final Map<MetricSampler, List<RecordedDeviation>> private final Executorprivate booleanprivate final MetricsPersisterprivate final MetricsSamplerProviderprivate final Consumer<ProfileResults> static final intprivate ProfileCollectorprivate final ContinuousProfilerprivate Set<MetricSampler> private final LongSupplier -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateActiveMetricsRecorder(MetricsSamplerProvider metricsSamplerProvider, LongSupplier wallTimeSource, Executor ioExecutor, MetricsPersister metricPersister, Consumer<ProfileResults> onProfilerEnd, Consumer<Path> onReportFinished) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()private voidcleanup(Collection<MetricSampler> samplers) static ActiveMetricsRecordercreateStarted(MetricsSamplerProvider metricsSamplerProvider, LongSupplier wallTimeSource, Executor ioExecutor, MetricsPersister metricsPersister, Consumer<ProfileResults> onProfilerEnd, Consumer<Path> onReportFinished) voidend()voidendTick()booleanstatic voidregisterGlobalCompletionCallback(Consumer<Path> globalOnReportFinished) private voidscheduleSaveResults(ProfileResults results) voidprivate void
-
Field Details
-
PROFILING_MAX_DURATION_SECONDS
public static final int PROFILING_MAX_DURATION_SECONDS- See Also:
-
globalOnReportFinished
-
deviationsBySampler
-
taskProfiler
-
ioExecutor
-
metricsPersister
-
onProfilingEnd
-
onReportFinished
-
metricsSamplerProvider
-
wallTimeSource
-
deadlineNano
private final long deadlineNano -
currentTick
private int currentTick -
singleTickProfiler
-
killSwitch
private volatile boolean killSwitch -
thisTickSamplers
-
-
Constructor Details
-
ActiveMetricsRecorder
private ActiveMetricsRecorder(MetricsSamplerProvider metricsSamplerProvider, LongSupplier wallTimeSource, Executor ioExecutor, MetricsPersister metricPersister, Consumer<ProfileResults> onProfilerEnd, Consumer<Path> onReportFinished)
-
-
Method Details
-
createStarted
public static ActiveMetricsRecorder createStarted(MetricsSamplerProvider metricsSamplerProvider, LongSupplier wallTimeSource, Executor ioExecutor, MetricsPersister metricsPersister, Consumer<ProfileResults> onProfilerEnd, Consumer<Path> onReportFinished) -
end
public void end()- Specified by:
endin interfaceMetricsRecorder
-
cancel
public void cancel()- Specified by:
cancelin interfaceMetricsRecorder
-
startTick
public void startTick()- Specified by:
startTickin interfaceMetricsRecorder
-
endTick
public void endTick()- Specified by:
endTickin interfaceMetricsRecorder
-
isRecording
public boolean isRecording()- Specified by:
isRecordingin interfaceMetricsRecorder
-
getProfiler
- Specified by:
getProfilerin interfaceMetricsRecorder
-
verifyStarted
private void verifyStarted() -
scheduleSaveResults
-
cleanup
-
registerGlobalCompletionCallback
-