java.lang.Object
java.lang.Record
org.elasticsearch.script.ScriptStats
- Record Components:
contextStats
- A list of differentScriptContextStats
compilations
- Total number of compilations.cacheEvictions
- Total number of evictions.compilationLimitTriggered
- Total number of times that the compilation time has been reached.compilationsHistory
- Historical information of the compilations in timeseries format.cacheEvictionsHistory
- Historical information of the evictions in timeseries format.
- All Implemented Interfaces:
Writeable
,ChunkedToXContent
public record ScriptStats(List<ScriptContextStats> contextStats, long compilations, long cacheEvictions, long compilationLimitTriggered, TimeSeries compilationsHistory, TimeSeries cacheEvictionsHistory)
extends Record
implements Writeable, ChunkedToXContent
Record object that holds global statistics of the scripts in a node.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsFields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTY
-
Constructor Summary
ConstructorsConstructorDescriptionScriptStats
(long compilations, long cacheEvictions, long compilationLimitTriggered, TimeSeries compilationsHistory, TimeSeries cacheEvictionsHistory) ScriptStats
(List<ScriptContextStats> contextStats, long compilations, long cacheEvictions, long compilationLimitTriggered, TimeSeries compilationsHistory, TimeSeries cacheEvictionsHistory) Creates an instance of aScriptStats
record class. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the value of thecacheEvictions
record component.Returns the value of thecacheEvictionsHistory
record component.long
Returns the value of thecompilationLimitTriggered
record component.long
Returns the value of thecompilations
record component.Returns the value of thecompilationsHistory
record component.Returns the value of thecontextStats
record component.final boolean
Indicates whether some other object is "equal to" this one.long
long
long
final int
hashCode()
Returns a hash code value for this object.static ScriptStats
merge
(ScriptStats first, ScriptStats second) static ScriptStats
read
(List<ScriptContextStats> contextStats) static ScriptStats
read
(StreamInput in) static ScriptStats
read
(ScriptContextStats context) 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, toXContentChunked, toXContentChunkedV8
-
Field Details
-
IDENTITY
-
-
Constructor Details
-
ScriptStats
public ScriptStats(long compilations, long cacheEvictions, long compilationLimitTriggered, TimeSeries compilationsHistory, TimeSeries cacheEvictionsHistory) -
ScriptStats
public ScriptStats(List<ScriptContextStats> contextStats, long compilations, long cacheEvictions, long compilationLimitTriggered, TimeSeries compilationsHistory, TimeSeries cacheEvictionsHistory) Creates an instance of aScriptStats
record class.- Parameters:
contextStats
- the value for thecontextStats
record componentcompilations
- the value for thecompilations
record componentcacheEvictions
- the value for thecacheEvictions
record componentcompilationLimitTriggered
- the value for thecompilationLimitTriggered
record componentcompilationsHistory
- the value for thecompilationsHistory
record componentcacheEvictionsHistory
- the value for thecacheEvictionsHistory
record component
-
-
Method Details
-
merge
-
read
-
read
-
read
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
getContextStats
-
getCompilations
public long getCompilations() -
getCacheEvictions
public long getCacheEvictions() -
getCompilationLimitTriggered
public long getCompilationLimitTriggered() -
toScriptCacheStats
-
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 '=='. -
contextStats
Returns the value of thecontextStats
record component.- Returns:
- the value of the
contextStats
record component
-
compilations
public long compilations()Returns the value of thecompilations
record component.- Returns:
- the value of the
compilations
record component
-
cacheEvictions
public long cacheEvictions()Returns the value of thecacheEvictions
record component.- Returns:
- the value of the
cacheEvictions
record component
-
compilationLimitTriggered
public long compilationLimitTriggered()Returns the value of thecompilationLimitTriggered
record component.- Returns:
- the value of the
compilationLimitTriggered
record component
-
compilationsHistory
Returns the value of thecompilationsHistory
record component.- Returns:
- the value of the
compilationsHistory
record component
-
cacheEvictionsHistory
Returns the value of thecacheEvictionsHistory
record component.- Returns:
- the value of the
cacheEvictionsHistory
record component
-