Class CommandContext.ArgumentTiming

  • Enclosing class:
    CommandContext<C>

    public static final class CommandContext.ArgumentTiming
    extends java.lang.Object
    Used to track performance metrics related to command parsing. This is attached to the command context, as this depends on the command context that is being parsed.

    The times are measured in nanoseconds.

    • Constructor Summary

      Constructors 
      Constructor Description
      ArgumentTiming()
      Created a new argument timing instance
      ArgumentTiming​(long start)
      Created a new argument timing instance without an end time
      ArgumentTiming​(long start, long end, boolean success)
      Created a new argument timing instance
    • Method Summary

      Modifier and Type Method Description
      long getElapsedTime()
      Get the elapsed time
      void setEnd​(long end, boolean success)
      Set the end time
      void setStart​(long start)
      Set the start time
      boolean wasSuccess()
      Check whether or not the value was parsed successfully
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArgumentTiming

        public ArgumentTiming​(long start,
                              long end,
                              boolean success)
        Created a new argument timing instance
        Parameters:
        start - Start time (in nanoseconds)
        end - End time (in nanoseconds)
        success - Whether or not the argument was parsed successfully
      • ArgumentTiming

        public ArgumentTiming​(long start)
        Created a new argument timing instance without an end time
        Parameters:
        start - Start time (in nanoseconds)
      • ArgumentTiming

        public ArgumentTiming()
        Created a new argument timing instance
    • Method Detail

      • getElapsedTime

        public long getElapsedTime()
        Get the elapsed time
        Returns:
        Elapsed time (in nanoseconds)
      • setEnd

        public void setEnd​(long end,
                           boolean success)
        Set the end time
        Parameters:
        end - End time (in nanoseconds)
        success - Whether or not the argument was parsed successfully
      • setStart

        public void setStart​(long start)
        Set the start time
        Parameters:
        start - Start time (in nanoseconds)
      • wasSuccess

        public boolean wasSuccess()
        Check whether or not the value was parsed successfully
        Returns:
        true if the value was parsed successfully, false if not