Record Class ScriptStats

java.lang.Object
java.lang.Record
org.elasticsearch.script.ScriptStats
Record Components:
contextStats - A list of different ScriptContextStats
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.
  • Field Details

  • 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 a ScriptStats record class.
      Parameters:
      contextStats - the value for the contextStats record component
      compilations - the value for the compilations record component
      cacheEvictions - the value for the cacheEvictions record component
      compilationLimitTriggered - the value for the compilationLimitTriggered record component
      compilationsHistory - the value for the compilationsHistory record component
      cacheEvictionsHistory - the value for the cacheEvictionsHistory record component
  • Method Details

    • merge

      public static ScriptStats merge(ScriptStats first, ScriptStats second)
    • read

      public static ScriptStats read(List<ScriptContextStats> contextStats)
    • read

      public static ScriptStats read(ScriptContextStats context)
    • read

      public static ScriptStats read(StreamInput in) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • getContextStats

      public List<ScriptContextStats> getContextStats()
    • getCompilations

      public long getCompilations()
    • getCacheEvictions

      public long getCacheEvictions()
    • getCompilationLimitTriggered

      public long getCompilationLimitTriggered()
    • toScriptCacheStats

      public ScriptCacheStats toScriptCacheStats()
    • toXContentChunked

      public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params outerParams)
      Description copied from interface: ChunkedToXContent
      Create an iterator of ToXContent chunks for a REST response. Each chunk is serialized with the same XContentBuilder and ToXContent.Params, which is also the same as the ToXContent.Params passed as the params argument. For best results, all chunks should be O(1) size. The last chunk in the iterator must always yield at least one byte of output. See also ChunkedToXContentHelper 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 interface ChunkedToXContent
      Returns:
      iterator over chunks of ToXContent
    • 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 '=='.
      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.
    • contextStats

      public List<ScriptContextStats> contextStats()
      Returns the value of the contextStats record component.
      Returns:
      the value of the contextStats record component
    • compilations

      public long compilations()
      Returns the value of the compilations record component.
      Returns:
      the value of the compilations record component
    • cacheEvictions

      public long cacheEvictions()
      Returns the value of the cacheEvictions record component.
      Returns:
      the value of the cacheEvictions record component
    • compilationLimitTriggered

      public long compilationLimitTriggered()
      Returns the value of the compilationLimitTriggered record component.
      Returns:
      the value of the compilationLimitTriggered record component
    • compilationsHistory

      public TimeSeries compilationsHistory()
      Returns the value of the compilationsHistory record component.
      Returns:
      the value of the compilationsHistory record component
    • cacheEvictionsHistory

      public TimeSeries cacheEvictionsHistory()
      Returns the value of the cacheEvictionsHistory record component.
      Returns:
      the value of the cacheEvictionsHistory record component