All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opentelemetry.proto.metrics.v1.AggregationTemporality.scala Maven / Gradle / Ivy

There is a newer version: 1.23.0-dev-f04150-1
Show newest version
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3

package io.opentelemetry.proto.metrics.v1

/** AggregationTemporality defines how a metric aggregator reports aggregated
  * values. It describes how those values relate to the time interval over
  * which they are aggregated.
  */
sealed abstract class AggregationTemporality(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
  type EnumType = AggregationTemporality
  def isAggregationTemporalityUnspecified: _root_.scala.Boolean = false
  def isAggregationTemporalityDelta: _root_.scala.Boolean = false
  def isAggregationTemporalityCumulative: _root_.scala.Boolean = false
  def companion: _root_.scalapb.GeneratedEnumCompanion[AggregationTemporality] = io.opentelemetry.proto.metrics.v1.AggregationTemporality
  final def asRecognized: _root_.scala.Option[io.opentelemetry.proto.metrics.v1.AggregationTemporality.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[io.opentelemetry.proto.metrics.v1.AggregationTemporality.Recognized])
}

object AggregationTemporality extends _root_.scalapb.GeneratedEnumCompanion[AggregationTemporality] {
  sealed trait Recognized extends AggregationTemporality
  implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[AggregationTemporality] = this
  
  /** UNSPECIFIED is the default AggregationTemporality, it MUST not be used.
    */
  @SerialVersionUID(0L)
  case object AGGREGATION_TEMPORALITY_UNSPECIFIED extends AggregationTemporality(0) with AggregationTemporality.Recognized {
    val index = 0
    val name = "AGGREGATION_TEMPORALITY_UNSPECIFIED"
    override def isAggregationTemporalityUnspecified: _root_.scala.Boolean = true
  }
  
  /** DELTA is an AggregationTemporality for a metric aggregator which reports
    * changes since last report time. Successive metrics contain aggregation of
    * values from continuous and non-overlapping intervals.
    *
    * The values for a DELTA metric are based only on the time interval
    * associated with one measurement cycle. There is no dependency on
    * previous measurements like is the case for CUMULATIVE metrics.
    *
    * For example, consider a system measuring the number of requests that
    * it receives and reports the sum of these requests every second as a
    * DELTA metric:
    *
    *   1. The system starts receiving at time=t_0.
    *   2. A request is received, the system measures 1 request.
    *   3. A request is received, the system measures 1 request.
    *   4. A request is received, the system measures 1 request.
    *   5. The 1 second collection cycle ends. A metric is exported for the
    *      number of requests received over the interval of time t_0 to
    *      t_0+1 with a value of 3.
    *   6. A request is received, the system measures 1 request.
    *   7. A request is received, the system measures 1 request.
    *   8. The 1 second collection cycle ends. A metric is exported for the
    *      number of requests received over the interval of time t_0+1 to
    *      t_0+2 with a value of 2.
    */
  @SerialVersionUID(0L)
  case object AGGREGATION_TEMPORALITY_DELTA extends AggregationTemporality(1) with AggregationTemporality.Recognized {
    val index = 1
    val name = "AGGREGATION_TEMPORALITY_DELTA"
    override def isAggregationTemporalityDelta: _root_.scala.Boolean = true
  }
  
  /** CUMULATIVE is an AggregationTemporality for a metric aggregator which
    * reports changes since a fixed start time. This means that current values
    * of a CUMULATIVE metric depend on all previous measurements since the
    * start time. Because of this, the sender is required to retain this state
    * in some form. If this state is lost or invalidated, the CUMULATIVE metric
    * values MUST be reset and a new fixed start time following the last
    * reported measurement time sent MUST be used.
    *
    * For example, consider a system measuring the number of requests that
    * it receives and reports the sum of these requests every second as a
    * CUMULATIVE metric:
    *
    *   1. The system starts receiving at time=t_0.
    *   2. A request is received, the system measures 1 request.
    *   3. A request is received, the system measures 1 request.
    *   4. A request is received, the system measures 1 request.
    *   5. The 1 second collection cycle ends. A metric is exported for the
    *      number of requests received over the interval of time t_0 to
    *      t_0+1 with a value of 3.
    *   6. A request is received, the system measures 1 request.
    *   7. A request is received, the system measures 1 request.
    *   8. The 1 second collection cycle ends. A metric is exported for the
    *      number of requests received over the interval of time t_0 to
    *      t_0+2 with a value of 5.
    *   9. The system experiences a fault and loses state.
    *   10. The system recovers and resumes receiving at time=t_1.
    *   11. A request is received, the system measures 1 request.
    *   12. The 1 second collection cycle ends. A metric is exported for the
    *      number of requests received over the interval of time t_1 to
    *      t_0+1 with a value of 1.
    *
    * Note: Even though, when reporting changes since last report time, using
    * CUMULATIVE is valid, it is not recommended. This may cause problems for
    * systems that do not use start_time to determine when the aggregation
    * value was reset (e.g. Prometheus).
    */
  @SerialVersionUID(0L)
  case object AGGREGATION_TEMPORALITY_CUMULATIVE extends AggregationTemporality(2) with AggregationTemporality.Recognized {
    val index = 2
    val name = "AGGREGATION_TEMPORALITY_CUMULATIVE"
    override def isAggregationTemporalityCumulative: _root_.scala.Boolean = true
  }
  
  @SerialVersionUID(0L)
  final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends AggregationTemporality(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
  lazy val values = scala.collection.immutable.Seq(AGGREGATION_TEMPORALITY_UNSPECIFIED, AGGREGATION_TEMPORALITY_DELTA, AGGREGATION_TEMPORALITY_CUMULATIVE)
  def fromValue(__value: _root_.scala.Int): AggregationTemporality = __value match {
    case 0 => AGGREGATION_TEMPORALITY_UNSPECIFIED
    case 1 => AGGREGATION_TEMPORALITY_DELTA
    case 2 => AGGREGATION_TEMPORALITY_CUMULATIVE
    case __other => Unrecognized(__other)
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = MetricsProto.javaDescriptor.getEnumTypes().get(0)
  def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = MetricsProto.scalaDescriptor.enums(0)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy