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 Details

    • Metrics

      public Metrics(String name, int maxAllowedConcurrentCalls, int availableConcurrentCalls, long successfulCallsCount, long rejectedCallsCount, long totalCallsCount)
      Creates an instance of a Metrics record class.
      Parameters:
      name - the value for the name record component
      maxAllowedConcurrentCalls - the value for the maxAllowedConcurrentCalls record component
      availableConcurrentCalls - the value for the availableConcurrentCalls record component
      successfulCallsCount - the value for the successfulCallsCount record component
      rejectedCallsCount - the value for the rejectedCallsCount record component
      totalCallsCount - the value for the totalCallsCount record 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

      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. 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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • maxAllowedConcurrentCalls

      public int maxAllowedConcurrentCalls()
      Returns the value of the maxAllowedConcurrentCalls record component.
      Returns:
      the value of the maxAllowedConcurrentCalls record component
    • availableConcurrentCalls

      public int availableConcurrentCalls()
      Returns the value of the availableConcurrentCalls record component.
      Returns:
      the value of the availableConcurrentCalls record component
    • successfulCallsCount

      public long successfulCallsCount()
      Returns the value of the successfulCallsCount record component.
      Returns:
      the value of the successfulCallsCount record component
    • rejectedCallsCount

      public long rejectedCallsCount()
      Returns the value of the rejectedCallsCount record component.
      Returns:
      the value of the rejectedCallsCount record component
    • totalCallsCount

      public long totalCallsCount()
      Returns the value of the totalCallsCount record component.
      Returns:
      the value of the totalCallsCount record component