Record Class LogMetrics.LogStats

java.lang.Object
java.lang.Record
cloud.opencode.base.log.enhance.LogMetrics.LogStats
Record Components:
totalLogs - total log count | 总日志计数
errorCount - error count | 错误计数
warnCount - warn count | 警告计数
infoCount - info count | 信息计数
debugCount - debug count | 调试计数
namedCounts - named metric counts | 命名指标计数
Enclosing class:
LogMetrics

public static record LogMetrics.LogStats(long totalLogs, long errorCount, long warnCount, long infoCount, long debugCount, Map<String,Long> namedCounts) extends Record
Log Statistics Snapshot 日志统计快照
Since:
JDK 25, opencode-base-log V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • LogStats

      public LogStats(long totalLogs, long errorCount, long warnCount, long infoCount, long debugCount, Map<String,Long> namedCounts)
      Creates an instance of a LogStats record class.
      Parameters:
      totalLogs - the value for the totalLogs record component
      errorCount - the value for the errorCount record component
      warnCount - the value for the warnCount record component
      infoCount - the value for the infoCount record component
      debugCount - the value for the debugCount record component
      namedCounts - the value for the namedCounts record component
  • Method Details

    • getNamedCount

      public long getNamedCount(String name)
      Gets count for a named metric 获取命名指标的计数
      Parameters:
      name - the metric name | 指标名
      Returns:
      the count | 计数
    • toString

      public 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • totalLogs

      public long totalLogs()
      Returns the value of the totalLogs record component.
      Returns:
      the value of the totalLogs record component
    • errorCount

      public long errorCount()
      Returns the value of the errorCount record component.
      Returns:
      the value of the errorCount record component
    • warnCount

      public long warnCount()
      Returns the value of the warnCount record component.
      Returns:
      the value of the warnCount record component
    • infoCount

      public long infoCount()
      Returns the value of the infoCount record component.
      Returns:
      the value of the infoCount record component
    • debugCount

      public long debugCount()
      Returns the value of the debugCount record component.
      Returns:
      the value of the debugCount record component
    • namedCounts

      public Map<String,Long> namedCounts()
      Returns the value of the namedCounts record component.
      Returns:
      the value of the namedCounts record component