Class ValidatingProfiler

java.lang.Object
frc.lib.profiling.ValidatingProfiler
All Implemented Interfaces:
Profiler

public final class ValidatingProfiler extends Object implements Profiler
This logger only performs validation (i.e. throws if pop is called with an empty stack). Otherwise, does nothing. Because there is no variance in doing nothing, a single instance is provided as INSTANCE.
  • Field Details

  • Method Details

    • save

      public void save()
      Description copied from interface: Profiler
      Write profile data to a file.
      Specified by:
      save in interface Profiler
    • 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.
      Specified by:
      startTick in interface Profiler
    • 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.
      Specified by:
      endTick in interface Profiler
    • push

      public void push(String location)
      Description copied from interface: Profiler
      The profile stack is pushed with the location as its top. Must be accompanied by a call to pop.
      Specified by:
      push in interface Profiler
    • pop

      public void pop()
      Description copied from interface: Profiler
      The profile stack is popped. Must be preceded (at some point) by a call to push.
      Specified by:
      pop in interface Profiler
    • reset

      public void reset()
      Description copied from interface: Profiler
      Reset logger.
      Specified by:
      reset in interface Profiler