Class CircuitBreakerStats

java.lang.Object
org.opensearch.core.indices.breaker.CircuitBreakerStats
All Implemented Interfaces:
Writeable, ToXContent, ToXContentObject

@PublicApi(since="1.0.0") public class CircuitBreakerStats extends Object implements Writeable, ToXContentObject
Class encapsulating stats about the CircuitBreaker
Opensearch.api:
  • Constructor Details

    • CircuitBreakerStats

      public CircuitBreakerStats(String name, long limit, long estimated, double overhead, long trippedCount)
      Constructs new instance
      Parameters:
      name - The name of the circuit breaker
      limit - The limit size in byte of the circuit breaker
      estimated - The estimated size in byte of the breaker
      overhead - The overhead of the breaker
      trippedCount - The number of times the breaker has been tripped
      See Also:
    • CircuitBreakerStats

      public CircuitBreakerStats(StreamInput in) throws IOException
      Constructs new instance from the StreamInput
      Parameters:
      in - The StreamInput
      Throws:
      IOException - if an error occurs while reading from the StreamInput
      See Also:
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Writes this instance into a StreamOutput
      Specified by:
      writeTo in interface Writeable
      Parameters:
      out - The StreamOutput
      Throws:
      IOException - if an error occurs while writing to the StreamOutput
      See Also:
    • getName

      public String getName()
      Returns the name of the circuit breaker
      Returns:
      The name of the circuit breaker
    • getLimit

      public long getLimit()
      Returns the limit size in byte of the circuit breaker
      Returns:
      The limit size in byte of the circuit breaker
    • getEstimated

      public long getEstimated()
      Returns the estimated size in byte of the breaker
      Returns:
      The estimated size in byte of the breaker
    • getTrippedCount

      public long getTrippedCount()
      Returns the number of times the breaker has been tripped
      Returns:
      The number of times the breaker has been tripped
    • getOverhead

      public double getOverhead()
      Returns the overhead of the breaker
      Returns:
      The overhead of the breaker
    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException
    • toString

      public String toString()
      Returns a String representation of this CircuitBreakerStats
      Overrides:
      toString in class Object
      Returns:
      "[name,limit=limit/limit_human,estimated=estimated/estimated_human,overhead=overhead,tripped=trippedCount]"