Module org.elasticsearch.server
Package org.elasticsearch.threadpool
Record Class ThreadPoolStats.Stats
java.lang.Object
java.lang.Record
org.elasticsearch.threadpool.ThreadPoolStats.Stats
- All Implemented Interfaces:
Comparable<ThreadPoolStats.Stats>
,Writeable
,ChunkedToXContent
- Enclosing class:
- ThreadPoolStats
public static record ThreadPoolStats.Stats(String name, int threads, int queue, int active, long rejected, int largest, long completed)
extends Record
implements Writeable, ChunkedToXContent, Comparable<ThreadPoolStats.Stats>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
active()
Returns the value of theactive
record component.int
compareTo
(ThreadPoolStats.Stats other) long
Returns the value of thecompleted
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
largest()
Returns the value of thelargest
record component.name()
Returns the value of thename
record component.int
queue()
Returns the value of thequeue
record component.long
rejected()
Returns the value of therejected
record component.int
threads()
Returns the value of thethreads
record component.final String
toString()
Returns a string representation of this record class.Iterator<? extends ToXContent>
toXContentChunked
(ToXContent.Params outerParams) Create an iterator ofToXContent
chunks for a REST response.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
isFragment, toXContentChunkedV7
-
Constructor Details
-
Stats
- Throws:
IOException
-
Stats
public Stats(String name, int threads, int queue, int active, long rejected, int largest, long completed) Creates an instance of aStats
record class.- Parameters:
name
- the value for thename
record componentthreads
- the value for thethreads
record componentqueue
- the value for thequeue
record componentactive
- the value for theactive
record componentrejected
- the value for therejected
record componentlargest
- the value for thelargest
record componentcompleted
- the value for thecompleted
record component
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ThreadPoolStats.Stats>
-
toXContentChunked
Description copied from interface:ChunkedToXContent
Create an iterator ofToXContent
chunks for a REST response. Each chunk is serialized with the sameXContentBuilder
andToXContent.Params
, which is also the same as theToXContent.Params
passed as theparams
argument. For best results, all chunks should beO(1)
size. The last chunk in the iterator must always yield at least one byte of output. See alsoChunkedToXContentHelper
for some handy utilities.Note that chunked response bodies cannot send deprecation warning headers once transmission has started, so implementations must check for deprecated feature use before returning.
- Specified by:
toXContentChunked
in interfaceChunkedToXContent
- Returns:
- iterator over chunks of
ToXContent
-
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. -
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. -
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 '=='. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
threads
public int threads()Returns the value of thethreads
record component.- Returns:
- the value of the
threads
record component
-
queue
public int queue()Returns the value of thequeue
record component.- Returns:
- the value of the
queue
record component
-
active
public int active()Returns the value of theactive
record component.- Returns:
- the value of the
active
record component
-
rejected
public long rejected()Returns the value of therejected
record component.- Returns:
- the value of the
rejected
record component
-
largest
public int largest()Returns the value of thelargest
record component.- Returns:
- the value of the
largest
record component
-
completed
public long completed()Returns the value of thecompleted
record component.- Returns:
- the value of the
completed
record component
-