![JAR search and dependency download from the Maven repository](/logo.png)
io.opencensus.proto.metrics.v1.TimeSeries.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of envoy-scala-control-plane_2.13 Show documentation
Show all versions of envoy-scala-control-plane_2.13 Show documentation
ScalaPB generated bindings for Envoy
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package io.opencensus.proto.metrics.v1
/** A collection of data points that describes the time-varying values
* of a metric.
*
* @param startTimestamp
* Must be present for cumulative metrics. The time when the cumulative value
* was reset to zero. Exclusive. The cumulative value is over the time interval
* (start_timestamp, timestamp]. If not specified, the backend can use the
* previous recorded value.
* @param labelValues
* The set of label values that uniquely identify this timeseries. Applies to
* all points. The order of label values must match that of label keys in the
* metric descriptor.
* @param points
* The data points of this timeseries. Point.value type MUST match the
* MetricDescriptor.type.
*/
@SerialVersionUID(0L)
final case class TimeSeries(
startTimestamp: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None,
labelValues: _root_.scala.Seq[io.opencensus.proto.metrics.v1.LabelValue] = _root_.scala.Seq.empty,
points: _root_.scala.Seq[io.opencensus.proto.metrics.v1.Point] = _root_.scala.Seq.empty,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[TimeSeries] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
if (startTimestamp.isDefined) {
val __value = startTimestamp.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
labelValues.foreach { __item =>
val __value = __item
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
}
points.foreach { __item =>
val __value = __item
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
}
__size += unknownFields.serializedSize
__size
}
override def serializedSize: _root_.scala.Int = {
var __size = __serializedSizeMemoized
if (__size == 0) {
__size = __computeSerializedSize() + 1
__serializedSizeMemoized = __size
}
__size - 1
}
def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
startTimestamp.foreach { __v =>
val __m = __v
_output__.writeTag(1, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
labelValues.foreach { __v =>
val __m = __v
_output__.writeTag(2, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
points.foreach { __v =>
val __m = __v
_output__.writeTag(3, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
unknownFields.writeTo(_output__)
}
def getStartTimestamp: com.google.protobuf.timestamp.Timestamp = startTimestamp.getOrElse(com.google.protobuf.timestamp.Timestamp.defaultInstance)
def clearStartTimestamp: TimeSeries = copy(startTimestamp = _root_.scala.None)
def withStartTimestamp(__v: com.google.protobuf.timestamp.Timestamp): TimeSeries = copy(startTimestamp = Option(__v))
def clearLabelValues = copy(labelValues = _root_.scala.Seq.empty)
def addLabelValues(__vs: io.opencensus.proto.metrics.v1.LabelValue *): TimeSeries = addAllLabelValues(__vs)
def addAllLabelValues(__vs: Iterable[io.opencensus.proto.metrics.v1.LabelValue]): TimeSeries = copy(labelValues = labelValues ++ __vs)
def withLabelValues(__v: _root_.scala.Seq[io.opencensus.proto.metrics.v1.LabelValue]): TimeSeries = copy(labelValues = __v)
def clearPoints = copy(points = _root_.scala.Seq.empty)
def addPoints(__vs: io.opencensus.proto.metrics.v1.Point *): TimeSeries = addAllPoints(__vs)
def addAllPoints(__vs: Iterable[io.opencensus.proto.metrics.v1.Point]): TimeSeries = copy(points = points ++ __vs)
def withPoints(__v: _root_.scala.Seq[io.opencensus.proto.metrics.v1.Point]): TimeSeries = copy(points = __v)
def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 1 => startTimestamp.orNull
case 2 => labelValues
case 3 => points
}
}
def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
_root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
(__field.number: @_root_.scala.unchecked) match {
case 1 => startTimestamp.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 2 => _root_.scalapb.descriptors.PRepeated(labelValues.iterator.map(_.toPMessage).toVector)
case 3 => _root_.scalapb.descriptors.PRepeated(points.iterator.map(_.toPMessage).toVector)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: io.opencensus.proto.metrics.v1.TimeSeries.type = io.opencensus.proto.metrics.v1.TimeSeries
// @@protoc_insertion_point(GeneratedMessage[opencensus.proto.metrics.v1.TimeSeries])
}
object TimeSeries extends scalapb.GeneratedMessageCompanion[io.opencensus.proto.metrics.v1.TimeSeries] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.opencensus.proto.metrics.v1.TimeSeries] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.opencensus.proto.metrics.v1.TimeSeries = {
var __startTimestamp: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None
val __labelValues: _root_.scala.collection.immutable.VectorBuilder[io.opencensus.proto.metrics.v1.LabelValue] = new _root_.scala.collection.immutable.VectorBuilder[io.opencensus.proto.metrics.v1.LabelValue]
val __points: _root_.scala.collection.immutable.VectorBuilder[io.opencensus.proto.metrics.v1.Point] = new _root_.scala.collection.immutable.VectorBuilder[io.opencensus.proto.metrics.v1.Point]
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 10 =>
__startTimestamp = Option(__startTimestamp.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.timestamp.Timestamp](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 18 =>
__labelValues += _root_.scalapb.LiteParser.readMessage[io.opencensus.proto.metrics.v1.LabelValue](_input__)
case 26 =>
__points += _root_.scalapb.LiteParser.readMessage[io.opencensus.proto.metrics.v1.Point](_input__)
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
io.opencensus.proto.metrics.v1.TimeSeries(
startTimestamp = __startTimestamp,
labelValues = __labelValues.result(),
points = __points.result(),
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[io.opencensus.proto.metrics.v1.TimeSeries] = _root_.scalapb.descriptors.Reads{
case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
_root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
io.opencensus.proto.metrics.v1.TimeSeries(
startTimestamp = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.timestamp.Timestamp]]),
labelValues = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Seq[io.opencensus.proto.metrics.v1.LabelValue]]).getOrElse(_root_.scala.Seq.empty),
points = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Seq[io.opencensus.proto.metrics.v1.Point]]).getOrElse(_root_.scala.Seq.empty)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = MetricsProto.javaDescriptor.getMessageTypes().get(3)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = MetricsProto.scalaDescriptor.messages(3)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
(__number: @_root_.scala.unchecked) match {
case 1 => __out = com.google.protobuf.timestamp.Timestamp
case 2 => __out = io.opencensus.proto.metrics.v1.LabelValue
case 3 => __out = io.opencensus.proto.metrics.v1.Point
}
__out
}
lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
lazy val defaultInstance = io.opencensus.proto.metrics.v1.TimeSeries(
startTimestamp = _root_.scala.None,
labelValues = _root_.scala.Seq.empty,
points = _root_.scala.Seq.empty
)
implicit class TimeSeriesLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.opencensus.proto.metrics.v1.TimeSeries]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.opencensus.proto.metrics.v1.TimeSeries](_l) {
def startTimestamp: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.timestamp.Timestamp] = field(_.getStartTimestamp)((c_, f_) => c_.copy(startTimestamp = Option(f_)))
def optionalStartTimestamp: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.timestamp.Timestamp]] = field(_.startTimestamp)((c_, f_) => c_.copy(startTimestamp = f_))
def labelValues: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[io.opencensus.proto.metrics.v1.LabelValue]] = field(_.labelValues)((c_, f_) => c_.copy(labelValues = f_))
def points: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[io.opencensus.proto.metrics.v1.Point]] = field(_.points)((c_, f_) => c_.copy(points = f_))
}
final val START_TIMESTAMP_FIELD_NUMBER = 1
final val LABEL_VALUES_FIELD_NUMBER = 2
final val POINTS_FIELD_NUMBER = 3
def of(
startTimestamp: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp],
labelValues: _root_.scala.Seq[io.opencensus.proto.metrics.v1.LabelValue],
points: _root_.scala.Seq[io.opencensus.proto.metrics.v1.Point]
): _root_.io.opencensus.proto.metrics.v1.TimeSeries = _root_.io.opencensus.proto.metrics.v1.TimeSeries(
startTimestamp,
labelValues,
points
)
// @@protoc_insertion_point(GeneratedMessageCompanion[opencensus.proto.metrics.v1.TimeSeries])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy