Class ThrownStats

java.lang.Object
org.apache.juneau.rest.server.stats.ThrownStats

public class ThrownStats extends Object
Represents an entry in ThrownStore.

The first message and stack trace are available to Java callers but are not part of the serialized bean, so statistics output carries only the class name, counts and timestamps.

See Also:

  • Constructor Details

  • Method Details

    • create

      public static ThrownStats.Builder create(BeanStore beanStore)
      Static creator.
      Parameters:
      beanStore - The bean store to use for creating beans.
      Returns:
      A new builder for this object.
    • copyOrNull

      public static ThrownStats copyOrNull(ThrownStats value)
      Null-safe copy: returns a deep copy of the specified value, or null if the value is null.
      Parameters:
      value - The value to copy. Can be null, in which case null is returned.
      Returns:
      A copy of the value, or null if the value was null.
    • getCausedBy

      Returns the stats on the caused-by exception.
      Returns:
      The stats on the caused-by exception, never null.
    • getCount

      public int getCount()
      Returns the number of times this exception occurred at a specific location in code.
      Returns:
      The number of times this exception occurred at a specific location in code.
    • getFirstMessage

      Returns the message of the first exception at a specific location in code.
      Returns:
      The message of the first exception at a specific location in code, or null if the exception had no message.
    • getFirstOccurrence

      public long getFirstOccurrence()
      Returns the UTC time of the first occurrence of this exception at a specific location in code.
      Returns:
      The UTC time of the first occurrence of this exception at a specific location in code.
    • getGuid

      public long getGuid()
      Returns a globally unique ID for this object.

      A random long generated during the creation of this object. Allows this object to be differentiated from other similar objects in multi-node environments so that statistics can be reliably stored in a centralized location.

      Returns:
      The globally unique ID for this object.
    • getHash

      public long getHash()
      Returns a hash of this exception that can typically be used to uniquely identify it.
      Returns:
      A hash of this exception.
    • getLastOccurrence

      public long getLastOccurrence()
      Returns the UTC time of the last occurrence of this exception at a specific location in code.
      Returns:
      The UTC time of the last occurrence of this exception at a specific location in code.
    • getStackTrace

      Returns the stack trace of the first exception at a specific location in code.
      Returns:
      The stack trace of the first exception at a specific location in code.
    • getThrownClass

      public Class<?> getThrownClass()
      Returns the exception class.
      Returns:
      The exception class.
    • increment

      Increments the occurrence count of this exception.
      Returns:
      This object.
    • properties

    • toString

      public String toString()
      Overrides:
      toString in class Object