Class InternalStats

All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment, Aggregation, NumericMetricsAggregation, NumericMetricsAggregation.MultiValue, Stats
Direct Known Subclasses:
InternalExtendedStats, InternalStatsBucket

public class InternalStats extends InternalNumericMetricsAggregation.MultiValue implements Stats
  • Field Details

    • count

      protected final long count
    • min

      protected final double min
    • max

      protected final double max
    • sum

      protected final double sum
  • Constructor Details

    • InternalStats

      public InternalStats( name, long count, double sum, double min, double max, DocValueFormat formatter, <,​> metadata)
    • InternalStats

      public InternalStats(StreamInput in) throws
      Read from a stream.
      Throws:
  • Method Details

    • doWriteTo

      protected final void doWriteTo(StreamOutput out) throws
      Specified by:
      doWriteTo in class InternalAggregation
      Throws:
    • writeOtherStatsTo

      protected void writeOtherStatsTo(StreamOutput out) throws
      Throws:
    • getWriteableName

      public  getWriteableName()
      Description copied from interface: NamedWriteable
      Returns the name of the writeable object
      Specified by:
      getWriteableName in interface NamedWriteable
    • getCount

      public long getCount()
      Specified by:
      getCount in interface Stats
      Returns:
      The number of values that were aggregated.
    • getMin

      public double getMin()
      Specified by:
      getMin in interface Stats
      Returns:
      The minimum value of all aggregated values.
    • getMax

      public double getMax()
      Specified by:
      getMax in interface Stats
      Returns:
      The maximum value of all aggregated values.
    • getAvg

      public double getAvg()
      Specified by:
      getAvg in interface Stats
      Returns:
      The avg value over all aggregated values.
    • getSum

      public double getSum()
      Specified by:
      getSum in interface Stats
      Returns:
      The sum of aggregated values.
    • getMinAsString

      public  getMinAsString()
      Specified by:
      getMinAsString in interface Stats
      Returns:
      The minimum value of all aggregated values as a String.
    • getMaxAsString

      public  getMaxAsString()
      Specified by:
      getMaxAsString in interface Stats
      Returns:
      The maximum value of all aggregated values as a String.
    • getAvgAsString

      public  getAvgAsString()
      Specified by:
      getAvgAsString in interface Stats
      Returns:
      The avg value over all aggregated values as a String.
    • getSumAsString

      public  getSumAsString()
      Specified by:
      getSumAsString in interface Stats
      Returns:
      The sum of aggregated values as a String.
    • value

      public double value( name)
      Description copied from interface: NumericMetricsAggregation.MultiValue
      Return the result of 1 value by name
      Specified by:
      value in interface NumericMetricsAggregation.MultiValue
      Specified by:
      value in class InternalNumericMetricsAggregation.MultiValue
      Parameters:
      name - of the value
      Returns:
      the value
    • valueNames

      public <> valueNames()
      Description copied from interface: NumericMetricsAggregation.MultiValue
      Return an iterable over all value names this multi value aggregation provides. The iterable might be created on the fly, if you need to call this multiple times, please cache the result in a variable on caller side..
      Specified by:
      valueNames in interface NumericMetricsAggregation.MultiValue
      Returns:
      iterable over all value names
    • reduce

      public <InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
      Description copied from class: InternalAggregation
      Reduces the given aggregations to a single one and returns it. In most cases, the assumption will be the all given aggregations are of the same type (the same type as this aggregation). For best efficiency, when implementing, try reusing an existing instance (typically the first in the given list) to save on redundant object construction.
      Specified by:
      reduce in class InternalAggregation
      See Also:
      InternalAggregation.mustReduceOnSingleInternalAgg()
    • doXContentBody

      public org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Specified by:
      doXContentBody in class InternalAggregation
      Throws:
    • otherStatsToXContent

      protected org.elasticsearch.common.xcontent.XContentBuilder otherStatsToXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Throws:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class InternalNumericMetricsAggregation
    • equals

      public boolean equals( obj)
      Overrides:
      equals in class InternalNumericMetricsAggregation