com.google.api.MetricDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lightstep-opentelemetry-auto-exporter Show documentation
Show all versions of lightstep-opentelemetry-auto-exporter Show documentation
Lightstep OpenTelemetry Auto Exporter
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/metric.proto
package com.google.api;
/**
*
* Defines a metric type and its schema. Once a metric descriptor is created,
* deleting or altering it stops data collection and makes the metric type's
* existing data unusable.
*
*
* Protobuf type {@code google.api.MetricDescriptor}
*/
public final class MetricDescriptor extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.MetricDescriptor)
MetricDescriptorOrBuilder {
private static final long serialVersionUID = 0L;
// Use MetricDescriptor.newBuilder() to construct.
private MetricDescriptor(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private MetricDescriptor() {
name_ = "";
type_ = "";
labels_ = java.util.Collections.emptyList();
metricKind_ = 0;
valueType_ = 0;
unit_ = "";
description_ = "";
displayName_ = "";
launchStage_ = 0;
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MetricDescriptor(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000004) != 0)) {
labels_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000004;
}
labels_.add(
input.readMessage(LabelDescriptor.parser(), extensionRegistry));
break;
}
case 24: {
int rawValue = input.readEnum();
metricKind_ = rawValue;
break;
}
case 32: {
int rawValue = input.readEnum();
valueType_ = rawValue;
break;
}
case 42: {
String s = input.readStringRequireUtf8();
unit_ = s;
break;
}
case 50: {
String s = input.readStringRequireUtf8();
description_ = s;
break;
}
case 58: {
String s = input.readStringRequireUtf8();
displayName_ = s;
break;
}
case 66: {
String s = input.readStringRequireUtf8();
type_ = s;
break;
}
case 82: {
MetricDescriptorMetadata.Builder subBuilder = null;
if (metadata_ != null) {
subBuilder = metadata_.toBuilder();
}
metadata_ = input.readMessage(MetricDescriptorMetadata.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(metadata_);
metadata_ = subBuilder.buildPartial();
}
break;
}
case 96: {
int rawValue = input.readEnum();
launchStage_ = rawValue;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000004) != 0)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return MetricProto.internal_static_google_api_MetricDescriptor_fieldAccessorTable
.ensureFieldAccessorsInitialized(
MetricDescriptor.class, Builder.class);
}
/**
*
* The kind of measurement. It describes how the data is reported.
*
*
* Protobuf enum {@code google.api.MetricDescriptor.MetricKind}
*/
public enum MetricKind
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Do not use this default value.
*
*
* METRIC_KIND_UNSPECIFIED = 0;
*/
METRIC_KIND_UNSPECIFIED(0),
/**
*
* An instantaneous measurement of a value.
*
*
* GAUGE = 1;
*/
GAUGE(1),
/**
*
* The change in a value during a time interval.
*
*
* DELTA = 2;
*/
DELTA(2),
/**
*
* A value accumulated over a time interval. Cumulative
* measurements in a time series should have the same start time
* and increasing end times, until an event resets the cumulative
* value to zero and sets a new start time for the following
* points.
*
*
* CUMULATIVE = 3;
*/
CUMULATIVE(3),
UNRECOGNIZED(-1),
;
/**
*
* Do not use this default value.
*
*
* METRIC_KIND_UNSPECIFIED = 0;
*/
public static final int METRIC_KIND_UNSPECIFIED_VALUE = 0;
/**
*
* An instantaneous measurement of a value.
*
*
* GAUGE = 1;
*/
public static final int GAUGE_VALUE = 1;
/**
*
* The change in a value during a time interval.
*
*
* DELTA = 2;
*/
public static final int DELTA_VALUE = 2;
/**
*
* A value accumulated over a time interval. Cumulative
* measurements in a time series should have the same start time
* and increasing end times, until an event resets the cumulative
* value to zero and sets a new start time for the following
* points.
*
*
* CUMULATIVE = 3;
*/
public static final int CUMULATIVE_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@Deprecated
public static MetricKind valueOf(int value) {
return forNumber(value);
}
public static MetricKind forNumber(int value) {
switch (value) {
case 0: return METRIC_KIND_UNSPECIFIED;
case 1: return GAUGE;
case 2: return DELTA;
case 3: return CUMULATIVE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
MetricKind> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public MetricKind findValueByNumber(int number) {
return MetricKind.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return MetricDescriptor.getDescriptor().getEnumTypes().get(0);
}
private static final MetricKind[] VALUES = values();
public static MetricKind valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private MetricKind(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.MetricKind)
}
/**
*
* The value type of a metric.
*
*
* Protobuf enum {@code google.api.MetricDescriptor.ValueType}
*/
public enum ValueType
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Do not use this default value.
*
*
* VALUE_TYPE_UNSPECIFIED = 0;
*/
VALUE_TYPE_UNSPECIFIED(0),
/**
*
* The value is a boolean.
* This value type can be used only if the metric kind is `GAUGE`.
*
*
* BOOL = 1;
*/
BOOL(1),
/**
*
* The value is a signed 64-bit integer.
*
*
* INT64 = 2;
*/
INT64(2),
/**
*
* The value is a double precision floating point number.
*
*
* DOUBLE = 3;
*/
DOUBLE(3),
/**
*
* The value is a text string.
* This value type can be used only if the metric kind is `GAUGE`.
*
*
* STRING = 4;
*/
STRING(4),
/**
*
* The value is a [`Distribution`][google.api.Distribution].
*
*
* DISTRIBUTION = 5;
*/
DISTRIBUTION(5),
/**
*
* The value is money.
*
*
* MONEY = 6;
*/
MONEY(6),
UNRECOGNIZED(-1),
;
/**
*
* Do not use this default value.
*
*
* VALUE_TYPE_UNSPECIFIED = 0;
*/
public static final int VALUE_TYPE_UNSPECIFIED_VALUE = 0;
/**
*
* The value is a boolean.
* This value type can be used only if the metric kind is `GAUGE`.
*
*
* BOOL = 1;
*/
public static final int BOOL_VALUE = 1;
/**
*
* The value is a signed 64-bit integer.
*
*
* INT64 = 2;
*/
public static final int INT64_VALUE = 2;
/**
*
* The value is a double precision floating point number.
*
*
* DOUBLE = 3;
*/
public static final int DOUBLE_VALUE = 3;
/**
*
* The value is a text string.
* This value type can be used only if the metric kind is `GAUGE`.
*
*
* STRING = 4;
*/
public static final int STRING_VALUE = 4;
/**
*
* The value is a [`Distribution`][google.api.Distribution].
*
*
* DISTRIBUTION = 5;
*/
public static final int DISTRIBUTION_VALUE = 5;
/**
*
* The value is money.
*
*
* MONEY = 6;
*/
public static final int MONEY_VALUE = 6;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@Deprecated
public static ValueType valueOf(int value) {
return forNumber(value);
}
public static ValueType forNumber(int value) {
switch (value) {
case 0: return VALUE_TYPE_UNSPECIFIED;
case 1: return BOOL;
case 2: return INT64;
case 3: return DOUBLE;
case 4: return STRING;
case 5: return DISTRIBUTION;
case 6: return MONEY;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
ValueType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public ValueType findValueByNumber(int number) {
return ValueType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return MetricDescriptor.getDescriptor().getEnumTypes().get(1);
}
private static final ValueType[] VALUES = values();
public static ValueType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private ValueType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.ValueType)
}
public interface MetricDescriptorMetadataOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.api.MetricDescriptor.MetricDescriptorMetadata)
com.google.protobuf.MessageOrBuilder {
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated int getLaunchStageValue();
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated LaunchStage getLaunchStage();
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
boolean hasSamplePeriod();
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
com.google.protobuf.Duration getSamplePeriod();
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder();
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
boolean hasIngestDelay();
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
com.google.protobuf.Duration getIngestDelay();
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder();
}
/**
*
* Additional annotations that can be used to guide the usage of a metric.
*
*
* Protobuf type {@code google.api.MetricDescriptor.MetricDescriptorMetadata}
*/
public static final class MetricDescriptorMetadata extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.MetricDescriptor.MetricDescriptorMetadata)
MetricDescriptorMetadataOrBuilder {
private static final long serialVersionUID = 0L;
// Use MetricDescriptorMetadata.newBuilder() to construct.
private MetricDescriptorMetadata(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private MetricDescriptorMetadata() {
launchStage_ = 0;
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MetricDescriptorMetadata(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
launchStage_ = rawValue;
break;
}
case 18: {
com.google.protobuf.Duration.Builder subBuilder = null;
if (samplePeriod_ != null) {
subBuilder = samplePeriod_.toBuilder();
}
samplePeriod_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(samplePeriod_);
samplePeriod_ = subBuilder.buildPartial();
}
break;
}
case 26: {
com.google.protobuf.Duration.Builder subBuilder = null;
if (ingestDelay_ != null) {
subBuilder = ingestDelay_.toBuilder();
}
ingestDelay_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(ingestDelay_);
ingestDelay_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return MetricProto.internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return MetricProto.internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_fieldAccessorTable
.ensureFieldAccessorsInitialized(
MetricDescriptorMetadata.class, Builder.class);
}
public static final int LAUNCH_STAGE_FIELD_NUMBER = 1;
private int launchStage_;
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated public int getLaunchStageValue() {
return launchStage_;
}
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated public LaunchStage getLaunchStage() {
@SuppressWarnings("deprecation")
LaunchStage result = LaunchStage.valueOf(launchStage_);
return result == null ? LaunchStage.UNRECOGNIZED : result;
}
public static final int SAMPLE_PERIOD_FIELD_NUMBER = 2;
private com.google.protobuf.Duration samplePeriod_;
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public boolean hasSamplePeriod() {
return samplePeriod_ != null;
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public com.google.protobuf.Duration getSamplePeriod() {
return samplePeriod_ == null ? com.google.protobuf.Duration.getDefaultInstance() : samplePeriod_;
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() {
return getSamplePeriod();
}
public static final int INGEST_DELAY_FIELD_NUMBER = 3;
private com.google.protobuf.Duration ingestDelay_;
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public boolean hasIngestDelay() {
return ingestDelay_ != null;
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public com.google.protobuf.Duration getIngestDelay() {
return ingestDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ingestDelay_;
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder() {
return getIngestDelay();
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (launchStage_ != LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) {
output.writeEnum(1, launchStage_);
}
if (samplePeriod_ != null) {
output.writeMessage(2, getSamplePeriod());
}
if (ingestDelay_ != null) {
output.writeMessage(3, getIngestDelay());
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (launchStage_ != LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, launchStage_);
}
if (samplePeriod_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getSamplePeriod());
}
if (ingestDelay_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getIngestDelay());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof MetricDescriptorMetadata)) {
return super.equals(obj);
}
MetricDescriptorMetadata other = (MetricDescriptorMetadata) obj;
if (launchStage_ != other.launchStage_) return false;
if (hasSamplePeriod() != other.hasSamplePeriod()) return false;
if (hasSamplePeriod()) {
if (!getSamplePeriod()
.equals(other.getSamplePeriod())) return false;
}
if (hasIngestDelay() != other.hasIngestDelay()) return false;
if (hasIngestDelay()) {
if (!getIngestDelay()
.equals(other.getIngestDelay())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + LAUNCH_STAGE_FIELD_NUMBER;
hash = (53 * hash) + launchStage_;
if (hasSamplePeriod()) {
hash = (37 * hash) + SAMPLE_PERIOD_FIELD_NUMBER;
hash = (53 * hash) + getSamplePeriod().hashCode();
}
if (hasIngestDelay()) {
hash = (37 * hash) + INGEST_DELAY_FIELD_NUMBER;
hash = (53 * hash) + getIngestDelay().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static MetricDescriptorMetadata parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MetricDescriptorMetadata parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MetricDescriptorMetadata parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MetricDescriptorMetadata parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MetricDescriptorMetadata parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MetricDescriptorMetadata parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MetricDescriptorMetadata parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static MetricDescriptorMetadata parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static MetricDescriptorMetadata parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static MetricDescriptorMetadata parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static MetricDescriptorMetadata parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static MetricDescriptorMetadata parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(MetricDescriptorMetadata prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Additional annotations that can be used to guide the usage of a metric.
*
*
* Protobuf type {@code google.api.MetricDescriptor.MetricDescriptorMetadata}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor.MetricDescriptorMetadata)
MetricDescriptorMetadataOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return MetricProto.internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return MetricProto.internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_fieldAccessorTable
.ensureFieldAccessorsInitialized(
MetricDescriptorMetadata.class, Builder.class);
}
// Construct using com.google.api.MetricDescriptor.MetricDescriptorMetadata.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
launchStage_ = 0;
if (samplePeriodBuilder_ == null) {
samplePeriod_ = null;
} else {
samplePeriod_ = null;
samplePeriodBuilder_ = null;
}
if (ingestDelayBuilder_ == null) {
ingestDelay_ = null;
} else {
ingestDelay_ = null;
ingestDelayBuilder_ = null;
}
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return MetricProto.internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor;
}
@Override
public MetricDescriptorMetadata getDefaultInstanceForType() {
return MetricDescriptorMetadata.getDefaultInstance();
}
@Override
public MetricDescriptorMetadata build() {
MetricDescriptorMetadata result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public MetricDescriptorMetadata buildPartial() {
MetricDescriptorMetadata result = new MetricDescriptorMetadata(this);
result.launchStage_ = launchStage_;
if (samplePeriodBuilder_ == null) {
result.samplePeriod_ = samplePeriod_;
} else {
result.samplePeriod_ = samplePeriodBuilder_.build();
}
if (ingestDelayBuilder_ == null) {
result.ingestDelay_ = ingestDelay_;
} else {
result.ingestDelay_ = ingestDelayBuilder_.build();
}
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof MetricDescriptorMetadata) {
return mergeFrom((MetricDescriptorMetadata)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(MetricDescriptorMetadata other) {
if (other == MetricDescriptorMetadata.getDefaultInstance()) return this;
if (other.launchStage_ != 0) {
setLaunchStageValue(other.getLaunchStageValue());
}
if (other.hasSamplePeriod()) {
mergeSamplePeriod(other.getSamplePeriod());
}
if (other.hasIngestDelay()) {
mergeIngestDelay(other.getIngestDelay());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
MetricDescriptorMetadata parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (MetricDescriptorMetadata) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int launchStage_ = 0;
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated public int getLaunchStageValue() {
return launchStage_;
}
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated public Builder setLaunchStageValue(int value) {
launchStage_ = value;
onChanged();
return this;
}
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated public LaunchStage getLaunchStage() {
@SuppressWarnings("deprecation")
LaunchStage result = LaunchStage.valueOf(launchStage_);
return result == null ? LaunchStage.UNRECOGNIZED : result;
}
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated public Builder setLaunchStage(LaunchStage value) {
if (value == null) {
throw new NullPointerException();
}
launchStage_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Deprecated. Please use the MetricDescriptor.launch_stage instead.
* The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 1 [deprecated = true];
*/
@Deprecated public Builder clearLaunchStage() {
launchStage_ = 0;
onChanged();
return this;
}
private com.google.protobuf.Duration samplePeriod_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> samplePeriodBuilder_;
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public boolean hasSamplePeriod() {
return samplePeriodBuilder_ != null || samplePeriod_ != null;
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public com.google.protobuf.Duration getSamplePeriod() {
if (samplePeriodBuilder_ == null) {
return samplePeriod_ == null ? com.google.protobuf.Duration.getDefaultInstance() : samplePeriod_;
} else {
return samplePeriodBuilder_.getMessage();
}
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public Builder setSamplePeriod(com.google.protobuf.Duration value) {
if (samplePeriodBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
samplePeriod_ = value;
onChanged();
} else {
samplePeriodBuilder_.setMessage(value);
}
return this;
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public Builder setSamplePeriod(
com.google.protobuf.Duration.Builder builderForValue) {
if (samplePeriodBuilder_ == null) {
samplePeriod_ = builderForValue.build();
onChanged();
} else {
samplePeriodBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public Builder mergeSamplePeriod(com.google.protobuf.Duration value) {
if (samplePeriodBuilder_ == null) {
if (samplePeriod_ != null) {
samplePeriod_ =
com.google.protobuf.Duration.newBuilder(samplePeriod_).mergeFrom(value).buildPartial();
} else {
samplePeriod_ = value;
}
onChanged();
} else {
samplePeriodBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public Builder clearSamplePeriod() {
if (samplePeriodBuilder_ == null) {
samplePeriod_ = null;
onChanged();
} else {
samplePeriod_ = null;
samplePeriodBuilder_ = null;
}
return this;
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public com.google.protobuf.Duration.Builder getSamplePeriodBuilder() {
onChanged();
return getSamplePeriodFieldBuilder().getBuilder();
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() {
if (samplePeriodBuilder_ != null) {
return samplePeriodBuilder_.getMessageOrBuilder();
} else {
return samplePeriod_ == null ?
com.google.protobuf.Duration.getDefaultInstance() : samplePeriod_;
}
}
/**
*
* The sampling period of metric data points. For metrics which are written
* periodically, consecutive data points are stored at this time interval,
* excluding data loss due to errors. Metrics with a higher granularity have
* a smaller sampling period.
*
*
* .google.protobuf.Duration sample_period = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>
getSamplePeriodFieldBuilder() {
if (samplePeriodBuilder_ == null) {
samplePeriodBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>(
getSamplePeriod(),
getParentForChildren(),
isClean());
samplePeriod_ = null;
}
return samplePeriodBuilder_;
}
private com.google.protobuf.Duration ingestDelay_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> ingestDelayBuilder_;
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public boolean hasIngestDelay() {
return ingestDelayBuilder_ != null || ingestDelay_ != null;
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public com.google.protobuf.Duration getIngestDelay() {
if (ingestDelayBuilder_ == null) {
return ingestDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ingestDelay_;
} else {
return ingestDelayBuilder_.getMessage();
}
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public Builder setIngestDelay(com.google.protobuf.Duration value) {
if (ingestDelayBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ingestDelay_ = value;
onChanged();
} else {
ingestDelayBuilder_.setMessage(value);
}
return this;
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public Builder setIngestDelay(
com.google.protobuf.Duration.Builder builderForValue) {
if (ingestDelayBuilder_ == null) {
ingestDelay_ = builderForValue.build();
onChanged();
} else {
ingestDelayBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public Builder mergeIngestDelay(com.google.protobuf.Duration value) {
if (ingestDelayBuilder_ == null) {
if (ingestDelay_ != null) {
ingestDelay_ =
com.google.protobuf.Duration.newBuilder(ingestDelay_).mergeFrom(value).buildPartial();
} else {
ingestDelay_ = value;
}
onChanged();
} else {
ingestDelayBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public Builder clearIngestDelay() {
if (ingestDelayBuilder_ == null) {
ingestDelay_ = null;
onChanged();
} else {
ingestDelay_ = null;
ingestDelayBuilder_ = null;
}
return this;
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public com.google.protobuf.Duration.Builder getIngestDelayBuilder() {
onChanged();
return getIngestDelayFieldBuilder().getBuilder();
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
public com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder() {
if (ingestDelayBuilder_ != null) {
return ingestDelayBuilder_.getMessageOrBuilder();
} else {
return ingestDelay_ == null ?
com.google.protobuf.Duration.getDefaultInstance() : ingestDelay_;
}
}
/**
*
* The delay of data points caused by ingestion. Data points older than this
* age are guaranteed to be ingested and available to be read, excluding
* data loss due to errors.
*
*
* .google.protobuf.Duration ingest_delay = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>
getIngestDelayFieldBuilder() {
if (ingestDelayBuilder_ == null) {
ingestDelayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>(
getIngestDelay(),
getParentForChildren(),
isClean());
ingestDelay_ = null;
}
return ingestDelayBuilder_;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor.MetricDescriptorMetadata)
}
// @@protoc_insertion_point(class_scope:google.api.MetricDescriptor.MetricDescriptorMetadata)
private static final MetricDescriptorMetadata DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new MetricDescriptorMetadata();
}
public static MetricDescriptorMetadata getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@Override
public MetricDescriptorMetadata parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MetricDescriptorMetadata(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@Override
public MetricDescriptorMetadata getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int bitField0_;
public static final int NAME_FIELD_NUMBER = 1;
private volatile Object name_;
/**
*
* The resource name of the metric descriptor.
*
*
* string name = 1;
*/
public String getName() {
Object ref = name_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
* The resource name of the metric descriptor.
*
*
* string name = 1;
*/
public com.google.protobuf.ByteString
getNameBytes() {
Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TYPE_FIELD_NUMBER = 8;
private volatile Object type_;
/**
*
* The metric type, including its DNS name prefix. The type is not
* URL-encoded. All user-defined metric types have the DNS name
* `custom.googleapis.com` or `external.googleapis.com`. Metric types should
* use a natural hierarchical grouping. For example:
* "custom.googleapis.com/invoice/paid/amount"
* "external.googleapis.com/prometheus/up"
* "appengine.googleapis.com/http/server/response_latencies"
*
*
* string type = 8;
*/
public String getType() {
Object ref = type_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
type_ = s;
return s;
}
}
/**
*
* The metric type, including its DNS name prefix. The type is not
* URL-encoded. All user-defined metric types have the DNS name
* `custom.googleapis.com` or `external.googleapis.com`. Metric types should
* use a natural hierarchical grouping. For example:
* "custom.googleapis.com/invoice/paid/amount"
* "external.googleapis.com/prometheus/up"
* "appengine.googleapis.com/http/server/response_latencies"
*
*
* string type = 8;
*/
public com.google.protobuf.ByteString
getTypeBytes() {
Object ref = type_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LABELS_FIELD_NUMBER = 2;
private java.util.List labels_;
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public java.util.List getLabelsList() {
return labels_;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public java.util.List extends com.google.api.LabelDescriptorOrBuilder>
getLabelsOrBuilderList() {
return labels_;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public int getLabelsCount() {
return labels_.size();
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public LabelDescriptor getLabels(int index) {
return labels_.get(index);
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(
int index) {
return labels_.get(index);
}
public static final int METRIC_KIND_FIELD_NUMBER = 3;
private int metricKind_;
/**
*
* Whether the metric records instantaneous values, changes to a value, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*/
public int getMetricKindValue() {
return metricKind_;
}
/**
*
* Whether the metric records instantaneous values, changes to a value, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*/
public MetricKind getMetricKind() {
@SuppressWarnings("deprecation")
MetricKind result = MetricKind.valueOf(metricKind_);
return result == null ? MetricKind.UNRECOGNIZED : result;
}
public static final int VALUE_TYPE_FIELD_NUMBER = 4;
private int valueType_;
/**
*
* Whether the measurement is an integer, a floating-point number, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.ValueType value_type = 4;
*/
public int getValueTypeValue() {
return valueType_;
}
/**
*
* Whether the measurement is an integer, a floating-point number, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.ValueType value_type = 4;
*/
public ValueType getValueType() {
@SuppressWarnings("deprecation")
ValueType result = ValueType.valueOf(valueType_);
return result == null ? ValueType.UNRECOGNIZED : result;
}
public static final int UNIT_FIELD_NUMBER = 5;
private volatile Object unit_;
/**
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
* * `1` represents dimensionless value 1, such as in `1/s`.
* * `%` represents dimensionless value 1/100, and annotates values giving
* a percentage.
*
*
* string unit = 5;
*/
public String getUnit() {
Object ref = unit_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
unit_ = s;
return s;
}
}
/**
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
* * `1` represents dimensionless value 1, such as in `1/s`.
* * `%` represents dimensionless value 1/100, and annotates values giving
* a percentage.
*
*
* string unit = 5;
*/
public com.google.protobuf.ByteString
getUnitBytes() {
Object ref = unit_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
unit_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DESCRIPTION_FIELD_NUMBER = 6;
private volatile Object description_;
/**
*
* A detailed description of the metric, which can be used in documentation.
*
*
* string description = 6;
*/
public String getDescription() {
Object ref = description_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
description_ = s;
return s;
}
}
/**
*
* A detailed description of the metric, which can be used in documentation.
*
*
* string description = 6;
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DISPLAY_NAME_FIELD_NUMBER = 7;
private volatile Object displayName_;
/**
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
* This field is optional but it is recommended to be set for any metrics
* associated with user-visible concepts, such as Quota.
*
*
* string display_name = 7;
*/
public String getDisplayName() {
Object ref = displayName_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
displayName_ = s;
return s;
}
}
/**
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
* This field is optional but it is recommended to be set for any metrics
* associated with user-visible concepts, such as Quota.
*
*
* string display_name = 7;
*/
public com.google.protobuf.ByteString
getDisplayNameBytes() {
Object ref = displayName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int METADATA_FIELD_NUMBER = 10;
private MetricDescriptorMetadata metadata_;
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public boolean hasMetadata() {
return metadata_ != null;
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public MetricDescriptorMetadata getMetadata() {
return metadata_ == null ? MetricDescriptorMetadata.getDefaultInstance() : metadata_;
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public MetricDescriptorMetadataOrBuilder getMetadataOrBuilder() {
return getMetadata();
}
public static final int LAUNCH_STAGE_FIELD_NUMBER = 12;
private int launchStage_;
/**
*
* Optional. The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 12;
*/
public int getLaunchStageValue() {
return launchStage_;
}
/**
*
* Optional. The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 12;
*/
public LaunchStage getLaunchStage() {
@SuppressWarnings("deprecation")
LaunchStage result = LaunchStage.valueOf(launchStage_);
return result == null ? LaunchStage.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
for (int i = 0; i < labels_.size(); i++) {
output.writeMessage(2, labels_.get(i));
}
if (metricKind_ != MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) {
output.writeEnum(3, metricKind_);
}
if (valueType_ != ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) {
output.writeEnum(4, valueType_);
}
if (!getUnitBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, unit_);
}
if (!getDescriptionBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_);
}
if (!getDisplayNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, displayName_);
}
if (!getTypeBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, type_);
}
if (metadata_ != null) {
output.writeMessage(10, getMetadata());
}
if (launchStage_ != LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) {
output.writeEnum(12, launchStage_);
}
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
for (int i = 0; i < labels_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, labels_.get(i));
}
if (metricKind_ != MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, metricKind_);
}
if (valueType_ != ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(4, valueType_);
}
if (!getUnitBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, unit_);
}
if (!getDescriptionBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_);
}
if (!getDisplayNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, displayName_);
}
if (!getTypeBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, type_);
}
if (metadata_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(10, getMetadata());
}
if (launchStage_ != LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(12, launchStage_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof MetricDescriptor)) {
return super.equals(obj);
}
MetricDescriptor other = (MetricDescriptor) obj;
if (!getName()
.equals(other.getName())) return false;
if (!getType()
.equals(other.getType())) return false;
if (!getLabelsList()
.equals(other.getLabelsList())) return false;
if (metricKind_ != other.metricKind_) return false;
if (valueType_ != other.valueType_) return false;
if (!getUnit()
.equals(other.getUnit())) return false;
if (!getDescription()
.equals(other.getDescription())) return false;
if (!getDisplayName()
.equals(other.getDisplayName())) return false;
if (hasMetadata() != other.hasMetadata()) return false;
if (hasMetadata()) {
if (!getMetadata()
.equals(other.getMetadata())) return false;
}
if (launchStage_ != other.launchStage_) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + getType().hashCode();
if (getLabelsCount() > 0) {
hash = (37 * hash) + LABELS_FIELD_NUMBER;
hash = (53 * hash) + getLabelsList().hashCode();
}
hash = (37 * hash) + METRIC_KIND_FIELD_NUMBER;
hash = (53 * hash) + metricKind_;
hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER;
hash = (53 * hash) + valueType_;
hash = (37 * hash) + UNIT_FIELD_NUMBER;
hash = (53 * hash) + getUnit().hashCode();
hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
hash = (53 * hash) + getDescription().hashCode();
hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
hash = (53 * hash) + getDisplayName().hashCode();
if (hasMetadata()) {
hash = (37 * hash) + METADATA_FIELD_NUMBER;
hash = (53 * hash) + getMetadata().hashCode();
}
hash = (37 * hash) + LAUNCH_STAGE_FIELD_NUMBER;
hash = (53 * hash) + launchStage_;
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static MetricDescriptor parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MetricDescriptor parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MetricDescriptor parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MetricDescriptor parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MetricDescriptor parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MetricDescriptor parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MetricDescriptor parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static MetricDescriptor parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static MetricDescriptor parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static MetricDescriptor parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static MetricDescriptor parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static MetricDescriptor parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(MetricDescriptor prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Defines a metric type and its schema. Once a metric descriptor is created,
* deleting or altering it stops data collection and makes the metric type's
* existing data unusable.
*
*
* Protobuf type {@code google.api.MetricDescriptor}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor)
com.google.api.MetricDescriptorOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return MetricProto.internal_static_google_api_MetricDescriptor_fieldAccessorTable
.ensureFieldAccessorsInitialized(
MetricDescriptor.class, Builder.class);
}
// Construct using com.google.api.MetricDescriptor.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getLabelsFieldBuilder();
}
}
@Override
public Builder clear() {
super.clear();
name_ = "";
type_ = "";
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
} else {
labelsBuilder_.clear();
}
metricKind_ = 0;
valueType_ = 0;
unit_ = "";
description_ = "";
displayName_ = "";
if (metadataBuilder_ == null) {
metadata_ = null;
} else {
metadata_ = null;
metadataBuilder_ = null;
}
launchStage_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
}
@Override
public MetricDescriptor getDefaultInstanceForType() {
return MetricDescriptor.getDefaultInstance();
}
@Override
public MetricDescriptor build() {
MetricDescriptor result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public MetricDescriptor buildPartial() {
MetricDescriptor result = new MetricDescriptor(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.name_ = name_;
result.type_ = type_;
if (labelsBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.labels_ = labels_;
} else {
result.labels_ = labelsBuilder_.build();
}
result.metricKind_ = metricKind_;
result.valueType_ = valueType_;
result.unit_ = unit_;
result.description_ = description_;
result.displayName_ = displayName_;
if (metadataBuilder_ == null) {
result.metadata_ = metadata_;
} else {
result.metadata_ = metadataBuilder_.build();
}
result.launchStage_ = launchStage_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof MetricDescriptor) {
return mergeFrom((MetricDescriptor)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(MetricDescriptor other) {
if (other == MetricDescriptor.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (!other.getType().isEmpty()) {
type_ = other.type_;
onChanged();
}
if (labelsBuilder_ == null) {
if (!other.labels_.isEmpty()) {
if (labels_.isEmpty()) {
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureLabelsIsMutable();
labels_.addAll(other.labels_);
}
onChanged();
}
} else {
if (!other.labels_.isEmpty()) {
if (labelsBuilder_.isEmpty()) {
labelsBuilder_.dispose();
labelsBuilder_ = null;
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00000004);
labelsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getLabelsFieldBuilder() : null;
} else {
labelsBuilder_.addAllMessages(other.labels_);
}
}
}
if (other.metricKind_ != 0) {
setMetricKindValue(other.getMetricKindValue());
}
if (other.valueType_ != 0) {
setValueTypeValue(other.getValueTypeValue());
}
if (!other.getUnit().isEmpty()) {
unit_ = other.unit_;
onChanged();
}
if (!other.getDescription().isEmpty()) {
description_ = other.description_;
onChanged();
}
if (!other.getDisplayName().isEmpty()) {
displayName_ = other.displayName_;
onChanged();
}
if (other.hasMetadata()) {
mergeMetadata(other.getMetadata());
}
if (other.launchStage_ != 0) {
setLaunchStageValue(other.getLaunchStageValue());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
MetricDescriptor parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (MetricDescriptor) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private Object name_ = "";
/**
*
* The resource name of the metric descriptor.
*
*
* string name = 1;
*/
public String getName() {
Object ref = name_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (String) ref;
}
}
/**
*
* The resource name of the metric descriptor.
*
*
* string name = 1;
*/
public com.google.protobuf.ByteString
getNameBytes() {
Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The resource name of the metric descriptor.
*
*
* string name = 1;
*/
public Builder setName(
String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
* The resource name of the metric descriptor.
*
*
* string name = 1;
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
* The resource name of the metric descriptor.
*
*
* string name = 1;
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private Object type_ = "";
/**
*
* The metric type, including its DNS name prefix. The type is not
* URL-encoded. All user-defined metric types have the DNS name
* `custom.googleapis.com` or `external.googleapis.com`. Metric types should
* use a natural hierarchical grouping. For example:
* "custom.googleapis.com/invoice/paid/amount"
* "external.googleapis.com/prometheus/up"
* "appengine.googleapis.com/http/server/response_latencies"
*
*
* string type = 8;
*/
public String getType() {
Object ref = type_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
type_ = s;
return s;
} else {
return (String) ref;
}
}
/**
*
* The metric type, including its DNS name prefix. The type is not
* URL-encoded. All user-defined metric types have the DNS name
* `custom.googleapis.com` or `external.googleapis.com`. Metric types should
* use a natural hierarchical grouping. For example:
* "custom.googleapis.com/invoice/paid/amount"
* "external.googleapis.com/prometheus/up"
* "appengine.googleapis.com/http/server/response_latencies"
*
*
* string type = 8;
*/
public com.google.protobuf.ByteString
getTypeBytes() {
Object ref = type_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The metric type, including its DNS name prefix. The type is not
* URL-encoded. All user-defined metric types have the DNS name
* `custom.googleapis.com` or `external.googleapis.com`. Metric types should
* use a natural hierarchical grouping. For example:
* "custom.googleapis.com/invoice/paid/amount"
* "external.googleapis.com/prometheus/up"
* "appengine.googleapis.com/http/server/response_latencies"
*
*
* string type = 8;
*/
public Builder setType(
String value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
onChanged();
return this;
}
/**
*
* The metric type, including its DNS name prefix. The type is not
* URL-encoded. All user-defined metric types have the DNS name
* `custom.googleapis.com` or `external.googleapis.com`. Metric types should
* use a natural hierarchical grouping. For example:
* "custom.googleapis.com/invoice/paid/amount"
* "external.googleapis.com/prometheus/up"
* "appengine.googleapis.com/http/server/response_latencies"
*
*
* string type = 8;
*/
public Builder clearType() {
type_ = getDefaultInstance().getType();
onChanged();
return this;
}
/**
*
* The metric type, including its DNS name prefix. The type is not
* URL-encoded. All user-defined metric types have the DNS name
* `custom.googleapis.com` or `external.googleapis.com`. Metric types should
* use a natural hierarchical grouping. For example:
* "custom.googleapis.com/invoice/paid/amount"
* "external.googleapis.com/prometheus/up"
* "appengine.googleapis.com/http/server/response_latencies"
*
*
* string type = 8;
*/
public Builder setTypeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
type_ = value;
onChanged();
return this;
}
private java.util.List labels_ =
java.util.Collections.emptyList();
private void ensureLabelsIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
labels_ = new java.util.ArrayList(labels_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
LabelDescriptor, LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder> labelsBuilder_;
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public java.util.List getLabelsList() {
if (labelsBuilder_ == null) {
return java.util.Collections.unmodifiableList(labels_);
} else {
return labelsBuilder_.getMessageList();
}
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public int getLabelsCount() {
if (labelsBuilder_ == null) {
return labels_.size();
} else {
return labelsBuilder_.getCount();
}
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public LabelDescriptor getLabels(int index) {
if (labelsBuilder_ == null) {
return labels_.get(index);
} else {
return labelsBuilder_.getMessage(index);
}
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder setLabels(
int index, LabelDescriptor value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.set(index, value);
onChanged();
} else {
labelsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder setLabels(
int index, LabelDescriptor.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.set(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder addLabels(LabelDescriptor value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(value);
onChanged();
} else {
labelsBuilder_.addMessage(value);
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder addLabels(
int index, LabelDescriptor value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(index, value);
onChanged();
} else {
labelsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder addLabels(
LabelDescriptor.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder addLabels(
int index, LabelDescriptor.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder addAllLabels(
Iterable extends LabelDescriptor> values) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, labels_);
onChanged();
} else {
labelsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder clearLabels() {
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
labelsBuilder_.clear();
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public Builder removeLabels(int index) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.remove(index);
onChanged();
} else {
labelsBuilder_.remove(index);
}
return this;
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public LabelDescriptor.Builder getLabelsBuilder(
int index) {
return getLabelsFieldBuilder().getBuilder(index);
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(
int index) {
if (labelsBuilder_ == null) {
return labels_.get(index); } else {
return labelsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public java.util.List extends com.google.api.LabelDescriptorOrBuilder>
getLabelsOrBuilderList() {
if (labelsBuilder_ != null) {
return labelsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(labels_);
}
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public LabelDescriptor.Builder addLabelsBuilder() {
return getLabelsFieldBuilder().addBuilder(
LabelDescriptor.getDefaultInstance());
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public LabelDescriptor.Builder addLabelsBuilder(
int index) {
return getLabelsFieldBuilder().addBuilder(
index, LabelDescriptor.getDefaultInstance());
}
/**
*
* The set of labels that can be used to describe a specific
* instance of this metric type. For example, the
* `appengine.googleapis.com/http/server/response_latencies` metric
* type has a label for the HTTP response code, `response_code`, so
* you can look at latencies for successful responses or just
* for responses that failed.
*
*
* repeated .google.api.LabelDescriptor labels = 2;
*/
public java.util.List
getLabelsBuilderList() {
return getLabelsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
LabelDescriptor, LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder>
getLabelsFieldBuilder() {
if (labelsBuilder_ == null) {
labelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
LabelDescriptor, LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder>(
labels_,
((bitField0_ & 0x00000004) != 0),
getParentForChildren(),
isClean());
labels_ = null;
}
return labelsBuilder_;
}
private int metricKind_ = 0;
/**
*
* Whether the metric records instantaneous values, changes to a value, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*/
public int getMetricKindValue() {
return metricKind_;
}
/**
*
* Whether the metric records instantaneous values, changes to a value, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*/
public Builder setMetricKindValue(int value) {
metricKind_ = value;
onChanged();
return this;
}
/**
*
* Whether the metric records instantaneous values, changes to a value, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*/
public MetricKind getMetricKind() {
@SuppressWarnings("deprecation")
MetricKind result = MetricKind.valueOf(metricKind_);
return result == null ? MetricKind.UNRECOGNIZED : result;
}
/**
*
* Whether the metric records instantaneous values, changes to a value, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*/
public Builder setMetricKind(MetricKind value) {
if (value == null) {
throw new NullPointerException();
}
metricKind_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Whether the metric records instantaneous values, changes to a value, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*/
public Builder clearMetricKind() {
metricKind_ = 0;
onChanged();
return this;
}
private int valueType_ = 0;
/**
*
* Whether the measurement is an integer, a floating-point number, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.ValueType value_type = 4;
*/
public int getValueTypeValue() {
return valueType_;
}
/**
*
* Whether the measurement is an integer, a floating-point number, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.ValueType value_type = 4;
*/
public Builder setValueTypeValue(int value) {
valueType_ = value;
onChanged();
return this;
}
/**
*
* Whether the measurement is an integer, a floating-point number, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.ValueType value_type = 4;
*/
public ValueType getValueType() {
@SuppressWarnings("deprecation")
ValueType result = ValueType.valueOf(valueType_);
return result == null ? ValueType.UNRECOGNIZED : result;
}
/**
*
* Whether the measurement is an integer, a floating-point number, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.ValueType value_type = 4;
*/
public Builder setValueType(ValueType value) {
if (value == null) {
throw new NullPointerException();
}
valueType_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Whether the measurement is an integer, a floating-point number, etc.
* Some combinations of `metric_kind` and `value_type` might not be supported.
*
*
* .google.api.MetricDescriptor.ValueType value_type = 4;
*/
public Builder clearValueType() {
valueType_ = 0;
onChanged();
return this;
}
private Object unit_ = "";
/**
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
* * `1` represents dimensionless value 1, such as in `1/s`.
* * `%` represents dimensionless value 1/100, and annotates values giving
* a percentage.
*
*
* string unit = 5;
*/
public String getUnit() {
Object ref = unit_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
unit_ = s;
return s;
} else {
return (String) ref;
}
}
/**
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
* * `1` represents dimensionless value 1, such as in `1/s`.
* * `%` represents dimensionless value 1/100, and annotates values giving
* a percentage.
*
*
* string unit = 5;
*/
public com.google.protobuf.ByteString
getUnitBytes() {
Object ref = unit_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
unit_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
* * `1` represents dimensionless value 1, such as in `1/s`.
* * `%` represents dimensionless value 1/100, and annotates values giving
* a percentage.
*
*
* string unit = 5;
*/
public Builder setUnit(
String value) {
if (value == null) {
throw new NullPointerException();
}
unit_ = value;
onChanged();
return this;
}
/**
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
* * `1` represents dimensionless value 1, such as in `1/s`.
* * `%` represents dimensionless value 1/100, and annotates values giving
* a percentage.
*
*
* string unit = 5;
*/
public Builder clearUnit() {
unit_ = getDefaultInstance().getUnit();
onChanged();
return this;
}
/**
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
* * `1` represents dimensionless value 1, such as in `1/s`.
* * `%` represents dimensionless value 1/100, and annotates values giving
* a percentage.
*
*
* string unit = 5;
*/
public Builder setUnitBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
unit_ = value;
onChanged();
return this;
}
private Object description_ = "";
/**
*
* A detailed description of the metric, which can be used in documentation.
*
*
* string description = 6;
*/
public String getDescription() {
Object ref = description_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
description_ = s;
return s;
} else {
return (String) ref;
}
}
/**
*
* A detailed description of the metric, which can be used in documentation.
*
*
* string description = 6;
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* A detailed description of the metric, which can be used in documentation.
*
*
* string description = 6;
*/
public Builder setDescription(
String value) {
if (value == null) {
throw new NullPointerException();
}
description_ = value;
onChanged();
return this;
}
/**
*
* A detailed description of the metric, which can be used in documentation.
*
*
* string description = 6;
*/
public Builder clearDescription() {
description_ = getDefaultInstance().getDescription();
onChanged();
return this;
}
/**
*
* A detailed description of the metric, which can be used in documentation.
*
*
* string description = 6;
*/
public Builder setDescriptionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
description_ = value;
onChanged();
return this;
}
private Object displayName_ = "";
/**
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
* This field is optional but it is recommended to be set for any metrics
* associated with user-visible concepts, such as Quota.
*
*
* string display_name = 7;
*/
public String getDisplayName() {
Object ref = displayName_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
displayName_ = s;
return s;
} else {
return (String) ref;
}
}
/**
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
* This field is optional but it is recommended to be set for any metrics
* associated with user-visible concepts, such as Quota.
*
*
* string display_name = 7;
*/
public com.google.protobuf.ByteString
getDisplayNameBytes() {
Object ref = displayName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
* This field is optional but it is recommended to be set for any metrics
* associated with user-visible concepts, such as Quota.
*
*
* string display_name = 7;
*/
public Builder setDisplayName(
String value) {
if (value == null) {
throw new NullPointerException();
}
displayName_ = value;
onChanged();
return this;
}
/**
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
* This field is optional but it is recommended to be set for any metrics
* associated with user-visible concepts, such as Quota.
*
*
* string display_name = 7;
*/
public Builder clearDisplayName() {
displayName_ = getDefaultInstance().getDisplayName();
onChanged();
return this;
}
/**
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
* This field is optional but it is recommended to be set for any metrics
* associated with user-visible concepts, such as Quota.
*
*
* string display_name = 7;
*/
public Builder setDisplayNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
displayName_ = value;
onChanged();
return this;
}
private MetricDescriptorMetadata metadata_;
private com.google.protobuf.SingleFieldBuilderV3<
MetricDescriptorMetadata, MetricDescriptorMetadata.Builder, MetricDescriptorMetadataOrBuilder> metadataBuilder_;
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public boolean hasMetadata() {
return metadataBuilder_ != null || metadata_ != null;
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public MetricDescriptorMetadata getMetadata() {
if (metadataBuilder_ == null) {
return metadata_ == null ? MetricDescriptorMetadata.getDefaultInstance() : metadata_;
} else {
return metadataBuilder_.getMessage();
}
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public Builder setMetadata(MetricDescriptorMetadata value) {
if (metadataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
metadata_ = value;
onChanged();
} else {
metadataBuilder_.setMessage(value);
}
return this;
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public Builder setMetadata(
MetricDescriptorMetadata.Builder builderForValue) {
if (metadataBuilder_ == null) {
metadata_ = builderForValue.build();
onChanged();
} else {
metadataBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public Builder mergeMetadata(MetricDescriptorMetadata value) {
if (metadataBuilder_ == null) {
if (metadata_ != null) {
metadata_ =
MetricDescriptorMetadata.newBuilder(metadata_).mergeFrom(value).buildPartial();
} else {
metadata_ = value;
}
onChanged();
} else {
metadataBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public Builder clearMetadata() {
if (metadataBuilder_ == null) {
metadata_ = null;
onChanged();
} else {
metadata_ = null;
metadataBuilder_ = null;
}
return this;
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public MetricDescriptorMetadata.Builder getMetadataBuilder() {
onChanged();
return getMetadataFieldBuilder().getBuilder();
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
public MetricDescriptorMetadataOrBuilder getMetadataOrBuilder() {
if (metadataBuilder_ != null) {
return metadataBuilder_.getMessageOrBuilder();
} else {
return metadata_ == null ?
MetricDescriptorMetadata.getDefaultInstance() : metadata_;
}
}
/**
*
* Optional. Metadata which can be used to guide usage of the metric.
*
*
* .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
*/
private com.google.protobuf.SingleFieldBuilderV3<
MetricDescriptorMetadata, MetricDescriptorMetadata.Builder, MetricDescriptorMetadataOrBuilder>
getMetadataFieldBuilder() {
if (metadataBuilder_ == null) {
metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
MetricDescriptorMetadata, MetricDescriptorMetadata.Builder, MetricDescriptorMetadataOrBuilder>(
getMetadata(),
getParentForChildren(),
isClean());
metadata_ = null;
}
return metadataBuilder_;
}
private int launchStage_ = 0;
/**
*
* Optional. The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 12;
*/
public int getLaunchStageValue() {
return launchStage_;
}
/**
*
* Optional. The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 12;
*/
public Builder setLaunchStageValue(int value) {
launchStage_ = value;
onChanged();
return this;
}
/**
*
* Optional. The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 12;
*/
public LaunchStage getLaunchStage() {
@SuppressWarnings("deprecation")
LaunchStage result = LaunchStage.valueOf(launchStage_);
return result == null ? LaunchStage.UNRECOGNIZED : result;
}
/**
*
* Optional. The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 12;
*/
public Builder setLaunchStage(LaunchStage value) {
if (value == null) {
throw new NullPointerException();
}
launchStage_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Optional. The launch stage of the metric definition.
*
*
* .google.api.LaunchStage launch_stage = 12;
*/
public Builder clearLaunchStage() {
launchStage_ = 0;
onChanged();
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor)
}
// @@protoc_insertion_point(class_scope:google.api.MetricDescriptor)
private static final MetricDescriptor DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new MetricDescriptor();
}
public static MetricDescriptor getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@Override
public MetricDescriptor parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MetricDescriptor(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@Override
public MetricDescriptor getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}