Class EsqlQueryProfile

java.lang.Object
org.elasticsearch.xpack.esql.action.EsqlQueryProfile
All Implemented Interfaces:
Writeable, ToXContent, ToXContentFragment

public class EsqlQueryProfile extends Object implements Writeable, ToXContentFragment
Tracks profiling for the planning phase
  • Field Details

  • Constructor Details

  • Method Details

    • readFrom

      public static EsqlQueryProfile readFrom(StreamInput in) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • start

      public EsqlQueryProfile start()
    • stop

      public EsqlQueryProfile stop()
    • total

      public TimeSpanMarker total()
    • planning

      public TimeSpanMarker planning()
      Span for the ES|QL "planning" phase - when it is complete, query execution (in ComputeService) is about to start. Note this is currently only built for a single phase planning/execution model. When INLINE STATS moves towards GA we may need to revisit this model. Currently, it should never be called more than once.
    • parsing

      public TimeSpanMarker parsing()
      Span for the parsing phase, that covers the ES|QL query parsing
    • viewResolution

      public TimeSpanMarker viewResolution()
      Span for resolving views in the logical plan (between parsing and pre-analysis).
    • datasetResolution

      public TimeSpanMarker datasetResolution()
      Span for rewriting datasets in the logical plan (between view resolution and pre-analysis).
    • preAnalysis

      public TimeSpanMarker preAnalysis()
      Span for the preanalysis phase
    • indicesResolutionMarker

      public TimeSpanMarker indicesResolutionMarker()
    • enrichResolutionMarker

      public TimeSpanMarker enrichResolutionMarker()
    • inferenceResolutionMarker

      public TimeSpanMarker inferenceResolutionMarker()
    • analysis

      public TimeSpanMarker analysis()
      Span for the plan analysis phase - this does not include plan optimizations, which come later and are part of each individual plan profiling
    • fieldCapsCalls

      public int fieldCapsCalls()
    • incFieldCapsCalls

      public void incFieldCapsCalls()
    • filesScanned

      public int filesScanned()
    • splitsScanned

      public int splitsScanned()
    • bytesScanned

      public long bytesScanned()
    • externalWarmAggregates

      public int externalWarmAggregates()
    • addExternalScanStats

      public void addExternalScanStats(int files, int splits, long bytes)
      Records the post-prune external scan accounting discovered for the query. Adds to any previously recorded counts so multiple split-discovery paths can contribute.
    • addExternalWarmAggregates

      public void addExternalWarmAggregates(int count)
      Records that count external relations were served warm — their ungrouped aggregate was answered from canonical-stripe / whole-file statistics with the data scan short-circuited away. Recorded at split-discovery time on the coordinator, where the short-circuit decision is made (see ComputeService.canSkipSplitDiscovery); no scan operator runs for a warm relation, so this is the only place the "served from stripes" signal is observable.
    • timeSpanMarkers

      public Collection<TimeSpanMarker> timeSpanMarkers()
    • setUnmappedResolution

      public void setUnmappedResolution(UnmappedResolution unmappedResolution)
    • unmappedResolution

      public UnmappedResolution unmappedResolution()
    • stopAllStartedMarkers

      public void stopAllStartedMarkers()
      Safely stops all markers that were started but not yet stopped. This is useful in error paths where we need to ensure all timing data is captured.
    • toXContent

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