Record Class Bulkhead.Metrics
java.lang.Object
java.lang.Record
cloud.opencode.base.cache.protection.Bulkhead.Metrics
- Record Components:
name- the bulkhead name | 舱壁名称maxAllowedConcurrentCalls- the maximum allowed concurrent calls | 最大并发调用数availableConcurrentCalls- the available concurrent call slots | 可用并发调用槽位successfulCallsCount- the number of successful calls | 成功调用数rejectedCallsCount- the number of rejected calls | 拒绝调用数totalCallsCount- the total number of calls | 总调用数
- Enclosing interface:
Bulkhead
public static record Bulkhead.Metrics(String name, int maxAllowedConcurrentCalls, int availableConcurrentCalls, long successfulCallsCount, long rejectedCallsCount, long totalCallsCount)
extends Record
Bulkhead metrics
舱壁指标
- Since:
- JDK 25, opencode-base-cache V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theavailableConcurrentCallsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxAllowedConcurrentCallsrecord component.name()Returns the value of thenamerecord component.longReturns the value of therejectedCallsCountrecord component.doubleGet rejection rate 获取拒绝率longReturns the value of thesuccessfulCallsCountrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalCallsCountrecord component.doubleGet utilization rate 获取利用率
-
Constructor Details
-
Metrics
public Metrics(String name, int maxAllowedConcurrentCalls, int availableConcurrentCalls, long successfulCallsCount, long rejectedCallsCount, long totalCallsCount) Creates an instance of aMetricsrecord class.- Parameters:
name- the value for thenamerecord componentmaxAllowedConcurrentCalls- the value for themaxAllowedConcurrentCallsrecord componentavailableConcurrentCalls- the value for theavailableConcurrentCallsrecord componentsuccessfulCallsCount- the value for thesuccessfulCallsCountrecord componentrejectedCallsCount- the value for therejectedCallsCountrecord componenttotalCallsCount- the value for thetotalCallsCountrecord component
-
-
Method Details
-
rejectionRate
public double rejectionRate()Get rejection rate 获取拒绝率- Returns:
- rejection rate (0.0 to 1.0) | 拒绝率 (0.0 到 1.0)
-
utilizationRate
public double utilizationRate()Get utilization rate 获取利用率- Returns:
- utilization rate (0.0 to 1.0) | 利用率 (0.0 到 1.0)
-
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. -
name
-
maxAllowedConcurrentCalls
public int maxAllowedConcurrentCalls()Returns the value of themaxAllowedConcurrentCallsrecord component.- Returns:
- the value of the
maxAllowedConcurrentCallsrecord component
-
availableConcurrentCalls
public int availableConcurrentCalls()Returns the value of theavailableConcurrentCallsrecord component.- Returns:
- the value of the
availableConcurrentCallsrecord component
-
successfulCallsCount
public long successfulCallsCount()Returns the value of thesuccessfulCallsCountrecord component.- Returns:
- the value of the
successfulCallsCountrecord component
-
rejectedCallsCount
public long rejectedCallsCount()Returns the value of therejectedCallsCountrecord component.- Returns:
- the value of the
rejectedCallsCountrecord component
-
totalCallsCount
public long totalCallsCount()Returns the value of thetotalCallsCountrecord component.- Returns:
- the value of the
totalCallsCountrecord component
-