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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thedebugCountrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theerrorCountrecord component.longgetNamedCount(String name) Gets count for a named metric 获取命名指标的计数final inthashCode()Returns a hash code value for this object.longReturns the value of theinfoCountrecord component.Returns the value of thenamedCountsrecord component.toString()Returns a string representation of this record class.longReturns the value of thetotalLogsrecord component.longReturns the value of thewarnCountrecord component.
-
Constructor Details
-
LogStats
public LogStats(long totalLogs, long errorCount, long warnCount, long infoCount, long debugCount, Map<String, Long> namedCounts) Creates an instance of aLogStatsrecord class.- Parameters:
totalLogs- the value for thetotalLogsrecord componenterrorCount- the value for theerrorCountrecord componentwarnCount- the value for thewarnCountrecord componentinfoCount- the value for theinfoCountrecord componentdebugCount- the value for thedebugCountrecord componentnamedCounts- the value for thenamedCountsrecord component
-
-
Method Details
-
getNamedCount
Gets count for a named metric 获取命名指标的计数- Parameters:
name- the metric name | 指标名- Returns:
- the count | 计数
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
totalLogs
-
errorCount
public long errorCount()Returns the value of theerrorCountrecord component.- Returns:
- the value of the
errorCountrecord component
-
warnCount
-
infoCount
-
debugCount
public long debugCount()Returns the value of thedebugCountrecord component.- Returns:
- the value of the
debugCountrecord component
-
namedCounts
Returns the value of thenamedCountsrecord component.- Returns:
- the value of the
namedCountsrecord component
-