Class TracingInfo


  • final class TracingInfo
    extends java.lang.Object
    Collects tracing messages for a request.
    Since:
    2.3
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TracingInfo.Message
      A trace message.
    • Constructor Summary

      Constructors 
      Constructor Description
      TracingInfo()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addMessage​(TracingInfo.Message message)
      Add other tracing message.
      static java.lang.String formatDuration​(long duration)
      Format time duration in millis with accurate to 2 decimal places.
      static java.lang.String formatDuration​(long fromTimestamp, long toTimestamp)
      Format time duration in millis with accurate to 2 decimal places.
      static java.lang.String formatPercent​(long value, long top)
      Format value from top value in percent with accurate to 2 decimal places.
      java.lang.String[] getMessages()
      Returns all collected messages enhanced by time duration data.
      • Methods inherited from class java.lang.Object

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

      • TracingInfo

        TracingInfo()
    • Method Detail

      • formatDuration

        public static java.lang.String formatDuration​(long duration)
        Format time duration in millis with accurate to 2 decimal places.
        Parameters:
        duration - time duration in nanos
        Returns:
        Formatted duration in millis.
      • formatDuration

        public static java.lang.String formatDuration​(long fromTimestamp,
                                                      long toTimestamp)
        Format time duration in millis with accurate to 2 decimal places.
        Parameters:
        fromTimestamp - start of time interval in nanos
        toTimestamp - end of time interval in nanos
        Returns:
        Formatted duration in millis.
      • formatPercent

        public static java.lang.String formatPercent​(long value,
                                                     long top)
        Format value from top value in percent with accurate to 2 decimal places.
        Parameters:
        value - part value according to top
        top - 100% value
        Returns:
        Formatted value in percent.
      • getMessages

        public java.lang.String[] getMessages()
        Returns all collected messages enhanced by time duration data.
        Returns:
        all formatted messages
      • addMessage

        public void addMessage​(TracingInfo.Message message)
        Add other tracing message.
        Parameters:
        message - tracing message.