Package net.minecraft.util.profiler
Class ProfilerSystem
java.lang.Object
net.minecraft.util.profiler.ProfilerSystem
- All Implemented Interfaces:
Profiler,ReadableProfiler
public class ProfilerSystem extends Object implements ReadableProfiler
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classProfilerSystem.LocatedInfo -
Field Summary
Fields Modifier and Type Field Description private booleancheckTimeoutprivate ProfilerSystem.LocatedInfocurrentInfoprivate IntSupplierendTickGetterprivate Stringlocationprivate Map<String,ProfilerSystem.LocatedInfo>locationInfosprivate static LoggerLOGGERprivate List<String>pathprivate intstartTickprivate longstartTimeprivate booleantickStartedprivate LongSuppliertimeGetterprivate LongListtimeListprivate static longTIMEOUT_NANOSECONDS -
Constructor Summary
Constructors Constructor Description ProfilerSystem(LongSupplier timeGetter, IntSupplier tickGetter, boolean checkTimeout) -
Method Summary
Modifier and Type Method Description voidendTick()private ProfilerSystem.LocatedInfogetCurrentInfo()ProfileResultgetResult()voidpop()voidpush(String location)voidpush(Supplier<String> locationGetter)voidstartTick()voidswap(String location)voidswap(Supplier<String> locationGetter)voidvisit(String marker)Increment the visit count for a marker.voidvisit(Supplier<String> markerGetter)Increment the visit count for a marker.
-
Field Details
-
TIMEOUT_NANOSECONDS
private static final long TIMEOUT_NANOSECONDS -
LOGGER
-
path
-
timeList
-
locationInfos
-
endTickGetter
-
timeGetter
-
startTime
private final long startTime -
startTick
private final int startTick -
location
-
tickStarted
private boolean tickStarted -
currentInfo
-
checkTimeout
private final boolean checkTimeout
-
-
Constructor Details
-
ProfilerSystem
-
-
Method Details
-
startTick
public void startTick() -
endTick
public void endTick() -
push
-
push
-
pop
public void pop() -
swap
-
swap
-
getCurrentInfo
-
visit
Increment the visit count for a marker.This is useful to keep track of number of calls made to performance- wise expensive methods.
-
visit
Increment the visit count for a marker.This is useful to keep track of number of calls made to performance- wise expensive methods.
This method is preferred if getting the marker is costly; the supplier won't be called if the profiler is disabled.
-
getResult
- Specified by:
getResultin interfaceReadableProfiler
-