Package prometheus

Class Types.Histogram

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
prometheus.Types.Histogram
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable, Types.HistogramOrBuilder
Enclosing class:
Types

public static final class Types.Histogram extends com.google.protobuf.GeneratedMessage implements Types.HistogramOrBuilder
 A native histogram, also known as a sparse histogram.
 Original design doc:
 https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit
 The appendix of this design doc also explains the concept of float
 histograms. This Histogram message can represent both, the usual
 integer histogram as well as a float histogram.
 
Protobuf type prometheus.Histogram
See Also:
  • Field Details

    • COUNT_INT_FIELD_NUMBER

      public static final int COUNT_INT_FIELD_NUMBER
      See Also:
    • COUNT_FLOAT_FIELD_NUMBER

      public static final int COUNT_FLOAT_FIELD_NUMBER
      See Also:
    • SUM_FIELD_NUMBER

      public static final int SUM_FIELD_NUMBER
      See Also:
    • SCHEMA_FIELD_NUMBER

      public static final int SCHEMA_FIELD_NUMBER
      See Also:
    • ZERO_THRESHOLD_FIELD_NUMBER

      public static final int ZERO_THRESHOLD_FIELD_NUMBER
      See Also:
    • ZERO_COUNT_INT_FIELD_NUMBER

      public static final int ZERO_COUNT_INT_FIELD_NUMBER
      See Also:
    • ZERO_COUNT_FLOAT_FIELD_NUMBER

      public static final int ZERO_COUNT_FLOAT_FIELD_NUMBER
      See Also:
    • NEGATIVE_SPANS_FIELD_NUMBER

      public static final int NEGATIVE_SPANS_FIELD_NUMBER
      See Also:
    • NEGATIVE_DELTAS_FIELD_NUMBER

      public static final int NEGATIVE_DELTAS_FIELD_NUMBER
      See Also:
    • NEGATIVE_COUNTS_FIELD_NUMBER

      public static final int NEGATIVE_COUNTS_FIELD_NUMBER
      See Also:
    • POSITIVE_SPANS_FIELD_NUMBER

      public static final int POSITIVE_SPANS_FIELD_NUMBER
      See Also:
    • POSITIVE_DELTAS_FIELD_NUMBER

      public static final int POSITIVE_DELTAS_FIELD_NUMBER
      See Also:
    • POSITIVE_COUNTS_FIELD_NUMBER

      public static final int POSITIVE_COUNTS_FIELD_NUMBER
      See Also:
    • RESET_HINT_FIELD_NUMBER

      public static final int RESET_HINT_FIELD_NUMBER
      See Also:
    • TIMESTAMP_FIELD_NUMBER

      public static final int TIMESTAMP_FIELD_NUMBER
      See Also:
    • CUSTOM_VALUES_FIELD_NUMBER

      public static final int CUSTOM_VALUES_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • getCountCase

      public Types.Histogram.CountCase getCountCase()
      Specified by:
      getCountCase in interface Types.HistogramOrBuilder
    • getZeroCountCase

      public Types.Histogram.ZeroCountCase getZeroCountCase()
      Specified by:
      getZeroCountCase in interface Types.HistogramOrBuilder
    • hasCountInt

      public boolean hasCountInt()
      uint64 count_int = 1;
      Specified by:
      hasCountInt in interface Types.HistogramOrBuilder
      Returns:
      Whether the countInt field is set.
    • getCountInt

      public long getCountInt()
      uint64 count_int = 1;
      Specified by:
      getCountInt in interface Types.HistogramOrBuilder
      Returns:
      The countInt.
    • hasCountFloat

      public boolean hasCountFloat()
      double count_float = 2;
      Specified by:
      hasCountFloat in interface Types.HistogramOrBuilder
      Returns:
      Whether the countFloat field is set.
    • getCountFloat

      public double getCountFloat()
      double count_float = 2;
      Specified by:
      getCountFloat in interface Types.HistogramOrBuilder
      Returns:
      The countFloat.
    • getSum

      public double getSum()
       Sum of observations in the histogram.
       
      double sum = 3;
      Specified by:
      getSum in interface Types.HistogramOrBuilder
      Returns:
      The sum.
    • getSchema

      public int getSchema()
       The schema defines the bucket schema. Currently, valid numbers
       are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
       is a bucket boundary in each case, and then each power of two is
       divided into 2^n logarithmic buckets. Or in other words, each
       bucket boundary is the previous boundary times 2^(2^-n). In the
       future, more bucket schemas may be added using numbers < -4 or >
       8.
       
      sint32 schema = 4;
      Specified by:
      getSchema in interface Types.HistogramOrBuilder
      Returns:
      The schema.
    • getZeroThreshold

      public double getZeroThreshold()
       Breadth of the zero bucket.
       
      double zero_threshold = 5;
      Specified by:
      getZeroThreshold in interface Types.HistogramOrBuilder
      Returns:
      The zeroThreshold.
    • hasZeroCountInt

      public boolean hasZeroCountInt()
      uint64 zero_count_int = 6;
      Specified by:
      hasZeroCountInt in interface Types.HistogramOrBuilder
      Returns:
      Whether the zeroCountInt field is set.
    • getZeroCountInt

      public long getZeroCountInt()
      uint64 zero_count_int = 6;
      Specified by:
      getZeroCountInt in interface Types.HistogramOrBuilder
      Returns:
      The zeroCountInt.
    • hasZeroCountFloat

      public boolean hasZeroCountFloat()
      double zero_count_float = 7;
      Specified by:
      hasZeroCountFloat in interface Types.HistogramOrBuilder
      Returns:
      Whether the zeroCountFloat field is set.
    • getZeroCountFloat

      public double getZeroCountFloat()
      double zero_count_float = 7;
      Specified by:
      getZeroCountFloat in interface Types.HistogramOrBuilder
      Returns:
      The zeroCountFloat.
    • getNegativeSpansList

      public List<Types.BucketSpan> getNegativeSpansList()
       Negative Buckets.
       
      repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false];
      Specified by:
      getNegativeSpansList in interface Types.HistogramOrBuilder
    • getNegativeSpansOrBuilderList

      public List<? extends Types.BucketSpanOrBuilder> getNegativeSpansOrBuilderList()
       Negative Buckets.
       
      repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false];
      Specified by:
      getNegativeSpansOrBuilderList in interface Types.HistogramOrBuilder
    • getNegativeSpansCount

      public int getNegativeSpansCount()
       Negative Buckets.
       
      repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false];
      Specified by:
      getNegativeSpansCount in interface Types.HistogramOrBuilder
    • getNegativeSpans

      public Types.BucketSpan getNegativeSpans(int index)
       Negative Buckets.
       
      repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false];
      Specified by:
      getNegativeSpans in interface Types.HistogramOrBuilder
    • getNegativeSpansOrBuilder

      public Types.BucketSpanOrBuilder getNegativeSpansOrBuilder(int index)
       Negative Buckets.
       
      repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false];
      Specified by:
      getNegativeSpansOrBuilder in interface Types.HistogramOrBuilder
    • getNegativeDeltasList

      public List<Long> getNegativeDeltasList()
       Use either "negative_deltas" or "negative_counts", the former for
       regular histograms with integer counts, the latter for float
       histograms.
       
      repeated sint64 negative_deltas = 9;
      Specified by:
      getNegativeDeltasList in interface Types.HistogramOrBuilder
      Returns:
      A list containing the negativeDeltas.
    • getNegativeDeltasCount

      public int getNegativeDeltasCount()
       Use either "negative_deltas" or "negative_counts", the former for
       regular histograms with integer counts, the latter for float
       histograms.
       
      repeated sint64 negative_deltas = 9;
      Specified by:
      getNegativeDeltasCount in interface Types.HistogramOrBuilder
      Returns:
      The count of negativeDeltas.
    • getNegativeDeltas

      public long getNegativeDeltas(int index)
       Use either "negative_deltas" or "negative_counts", the former for
       regular histograms with integer counts, the latter for float
       histograms.
       
      repeated sint64 negative_deltas = 9;
      Specified by:
      getNegativeDeltas in interface Types.HistogramOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The negativeDeltas at the given index.
    • getNegativeCountsList

      public List<Double> getNegativeCountsList()
       Absolute count of each bucket.
       
      repeated double negative_counts = 10;
      Specified by:
      getNegativeCountsList in interface Types.HistogramOrBuilder
      Returns:
      A list containing the negativeCounts.
    • getNegativeCountsCount

      public int getNegativeCountsCount()
       Absolute count of each bucket.
       
      repeated double negative_counts = 10;
      Specified by:
      getNegativeCountsCount in interface Types.HistogramOrBuilder
      Returns:
      The count of negativeCounts.
    • getNegativeCounts

      public double getNegativeCounts(int index)
       Absolute count of each bucket.
       
      repeated double negative_counts = 10;
      Specified by:
      getNegativeCounts in interface Types.HistogramOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The negativeCounts at the given index.
    • getPositiveSpansList

      public List<Types.BucketSpan> getPositiveSpansList()
       Positive Buckets.
       
      repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false];
      Specified by:
      getPositiveSpansList in interface Types.HistogramOrBuilder
    • getPositiveSpansOrBuilderList

      public List<? extends Types.BucketSpanOrBuilder> getPositiveSpansOrBuilderList()
       Positive Buckets.
       
      repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false];
      Specified by:
      getPositiveSpansOrBuilderList in interface Types.HistogramOrBuilder
    • getPositiveSpansCount

      public int getPositiveSpansCount()
       Positive Buckets.
       
      repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false];
      Specified by:
      getPositiveSpansCount in interface Types.HistogramOrBuilder
    • getPositiveSpans

      public Types.BucketSpan getPositiveSpans(int index)
       Positive Buckets.
       
      repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false];
      Specified by:
      getPositiveSpans in interface Types.HistogramOrBuilder
    • getPositiveSpansOrBuilder

      public Types.BucketSpanOrBuilder getPositiveSpansOrBuilder(int index)
       Positive Buckets.
       
      repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false];
      Specified by:
      getPositiveSpansOrBuilder in interface Types.HistogramOrBuilder
    • getPositiveDeltasList

      public List<Long> getPositiveDeltasList()
       Use either "positive_deltas" or "positive_counts", the former for
       regular histograms with integer counts, the latter for float
       histograms.
       
      repeated sint64 positive_deltas = 12;
      Specified by:
      getPositiveDeltasList in interface Types.HistogramOrBuilder
      Returns:
      A list containing the positiveDeltas.
    • getPositiveDeltasCount

      public int getPositiveDeltasCount()
       Use either "positive_deltas" or "positive_counts", the former for
       regular histograms with integer counts, the latter for float
       histograms.
       
      repeated sint64 positive_deltas = 12;
      Specified by:
      getPositiveDeltasCount in interface Types.HistogramOrBuilder
      Returns:
      The count of positiveDeltas.
    • getPositiveDeltas

      public long getPositiveDeltas(int index)
       Use either "positive_deltas" or "positive_counts", the former for
       regular histograms with integer counts, the latter for float
       histograms.
       
      repeated sint64 positive_deltas = 12;
      Specified by:
      getPositiveDeltas in interface Types.HistogramOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The positiveDeltas at the given index.
    • getPositiveCountsList

      public List<Double> getPositiveCountsList()
       Absolute count of each bucket.
       
      repeated double positive_counts = 13;
      Specified by:
      getPositiveCountsList in interface Types.HistogramOrBuilder
      Returns:
      A list containing the positiveCounts.
    • getPositiveCountsCount

      public int getPositiveCountsCount()
       Absolute count of each bucket.
       
      repeated double positive_counts = 13;
      Specified by:
      getPositiveCountsCount in interface Types.HistogramOrBuilder
      Returns:
      The count of positiveCounts.
    • getPositiveCounts

      public double getPositiveCounts(int index)
       Absolute count of each bucket.
       
      repeated double positive_counts = 13;
      Specified by:
      getPositiveCounts in interface Types.HistogramOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The positiveCounts at the given index.
    • getResetHintValue

      public int getResetHintValue()
      .prometheus.Histogram.ResetHint reset_hint = 14;
      Specified by:
      getResetHintValue in interface Types.HistogramOrBuilder
      Returns:
      The enum numeric value on the wire for resetHint.
    • getResetHint

      public Types.Histogram.ResetHint getResetHint()
      .prometheus.Histogram.ResetHint reset_hint = 14;
      Specified by:
      getResetHint in interface Types.HistogramOrBuilder
      Returns:
      The resetHint.
    • getTimestamp

      public long getTimestamp()
       timestamp is in ms format, see model/timestamp/timestamp.go for
       conversion from time.Time to Prometheus timestamp.
       
      int64 timestamp = 15;
      Specified by:
      getTimestamp in interface Types.HistogramOrBuilder
      Returns:
      The timestamp.
    • getCustomValuesList

      public List<Double> getCustomValuesList()
       custom_values are not part of the specification, DO NOT use in remote write clients.
       Used only for converting from OpenTelemetry to Prometheus internally.
       
      repeated double custom_values = 16;
      Specified by:
      getCustomValuesList in interface Types.HistogramOrBuilder
      Returns:
      A list containing the customValues.
    • getCustomValuesCount

      public int getCustomValuesCount()
       custom_values are not part of the specification, DO NOT use in remote write clients.
       Used only for converting from OpenTelemetry to Prometheus internally.
       
      repeated double custom_values = 16;
      Specified by:
      getCustomValuesCount in interface Types.HistogramOrBuilder
      Returns:
      The count of customValues.
    • getCustomValues

      public double getCustomValues(int index)
       custom_values are not part of the specification, DO NOT use in remote write clients.
       Used only for converting from OpenTelemetry to Prometheus internally.
       
      repeated double custom_values = 16;
      Specified by:
      getCustomValues in interface Types.HistogramOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The customValues at the given index.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static Types.Histogram parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Types.Histogram parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Types.Histogram parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Types.Histogram parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Types.Histogram parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Types.Histogram parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Types.Histogram parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Types.Histogram parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Types.Histogram parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Types.Histogram parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Types.Histogram parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Types.Histogram parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public Types.Histogram.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static Types.Histogram.Builder newBuilder()
    • newBuilder

      public static Types.Histogram.Builder newBuilder(Types.Histogram prototype)
    • toBuilder

      public Types.Histogram.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected Types.Histogram.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static Types.Histogram getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<Types.Histogram> parser()
    • getParserForType

      public com.google.protobuf.Parser<Types.Histogram> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public Types.Histogram getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder