Package frc.lib.profiling
Class LoggingProfiler
java.lang.Object
frc.lib.profiling.LoggingProfiler
- All Implemented Interfaces:
Profiler
This logger saves runtime performance metrics to memory. These metrics are subsequently written
to a file when
save
is called.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Performance metrics for a given state of the profile stack. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
endTick()
Called at the bottom of the main loop.void
pop()
The profile stack is popped.void
The profile stack is pushed with thelocation
as its top.void
reset()
Reset logger.void
save()
Write profile data to a file.void
Called at the top of the main loop.
-
Constructor Details
-
LoggingProfiler
- Parameters:
timeGetter
- a supplier for the current time.timeDivisor
- a conversion factor turning the units oftimeGetter
to the units output to a file.
-
-
Method Details
-
save
public void save()Description copied from interface:Profiler
Write profile data to a file. -
startTick
public void startTick()Description copied from interface:Profiler
Called at the top of the main loop. Indicates the profiler is at "root" and records the start time. Within the main loop, no meaningful work should occur before this call. -
endTick
public void endTick()Description copied from interface:Profiler
Called at the bottom of the main loop. Indicates the profiler's "root" is finished, and its time usage metrics are updated. Within the main loop, no meaningful work should occur after this call. -
push
Description copied from interface:Profiler
The profile stack is pushed with thelocation
as its top. Must be accompanied by a call topop
. -
pop
public void pop()Description copied from interface:Profiler
The profile stack is popped. Must be preceded (at some point) by a call topush
. -
reset
public void reset()Description copied from interface:Profiler
Reset logger.
-