Record Class SlowLogCollector.Entry

java.lang.Object
java.lang.Record
cloud.opencode.base.observability.SlowLogCollector.Entry
Record Components:
operation - the operation name (e.g., GET, PUT) | 操作名称
key - the key or resource involved | 涉及的键或资源
elapsed - the elapsed duration of the operation | 操作的耗时
timestamp - the instant when the operation was recorded | 操作被记录的时间戳
threadName - the name of the thread that executed the operation | 执行线程名称
Enclosing class:
SlowLogCollector

public static record SlowLogCollector.Entry(String operation, String key, Duration elapsed, Instant timestamp, String threadName) extends Record
A single slow log entry capturing details of a slow operation. 单条慢日志条目,记录慢操作的详细信息。
Since:
JDK 25, opencode-base-observability V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Entry

      public Entry(String operation, String key, Duration elapsed, Instant timestamp, String threadName)
      Compact canonical constructor with null validation. 带空值验证的紧凑规范构造器。
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • operation

      public String operation()
      Returns the value of the operation record component.
      Returns:
      the value of the operation record component
    • key

      public String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • elapsed

      public Duration elapsed()
      Returns the value of the elapsed record component.
      Returns:
      the value of the elapsed record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • threadName

      public String threadName()
      Returns the value of the threadName record component.
      Returns:
      the value of the threadName record component