public static final class MetricDescriptor.Builder extends GeneratedMessageV3.Builder<MetricDescriptor.Builder> implements MetricDescriptorOrBuilder
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 google.api.MetricDescriptor
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > MetricDescriptor.BuilderImplements
MetricDescriptorOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptor |
Methods
addAllLabels(Iterable<? extends LabelDescriptor> values)
public MetricDescriptor.Builder addAllLabels(Iterable<? extends LabelDescriptor> values)
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;
Parameter | |
---|---|
Name | Description |
values |
Iterable<? extends com.google.api.LabelDescriptor> |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
addAllMonitoredResourceTypes(Iterable<String> values)
public MetricDescriptor.Builder addAllMonitoredResourceTypes(Iterable<String> values)
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Parameter | |
---|---|
Name | Description |
values |
Iterable<String> The monitoredResourceTypes to add. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
addLabels(LabelDescriptor value)
public MetricDescriptor.Builder addLabels(LabelDescriptor value)
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;
Parameter | |
---|---|
Name | Description |
value |
LabelDescriptor |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
addLabels(LabelDescriptor.Builder builderForValue)
public MetricDescriptor.Builder addLabels(LabelDescriptor.Builder builderForValue)
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;
Parameter | |
---|---|
Name | Description |
builderForValue |
LabelDescriptor.Builder |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
addLabels(int index, LabelDescriptor value)
public MetricDescriptor.Builder addLabels(int index, LabelDescriptor value)
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;
Parameters | |
---|---|
Name | Description |
index |
int |
value |
LabelDescriptor |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
addLabels(int index, LabelDescriptor.Builder builderForValue)
public MetricDescriptor.Builder addLabels(int index, LabelDescriptor.Builder builderForValue)
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;
Parameters | |
---|---|
Name | Description |
index |
int |
builderForValue |
LabelDescriptor.Builder |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
addLabelsBuilder()
public LabelDescriptor.Builder addLabelsBuilder()
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;
Returns | |
---|---|
Type | Description |
LabelDescriptor.Builder |
addLabelsBuilder(int index)
public LabelDescriptor.Builder addLabelsBuilder(int 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;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
LabelDescriptor.Builder |
addMonitoredResourceTypes(String value)
public MetricDescriptor.Builder addMonitoredResourceTypes(String value)
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Parameter | |
---|---|
Name | Description |
value |
String The monitoredResourceTypes to add. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
addMonitoredResourceTypesBytes(ByteString value)
public MetricDescriptor.Builder addMonitoredResourceTypesBytes(ByteString value)
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes of the monitoredResourceTypes to add. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public MetricDescriptor.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
build()
public MetricDescriptor build()
Returns | |
---|---|
Type | Description |
MetricDescriptor |
buildPartial()
public MetricDescriptor buildPartial()
Returns | |
---|---|
Type | Description |
MetricDescriptor |
clear()
public MetricDescriptor.Builder clear()
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
clearDescription()
public MetricDescriptor.Builder clearDescription()
A detailed description of the metric, which can be used in documentation.
string description = 6;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clearDisplayName()
public MetricDescriptor.Builder clearDisplayName()
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;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
public MetricDescriptor.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field |
FieldDescriptor |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
clearLabels()
public MetricDescriptor.Builder clearLabels()
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;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
clearLaunchStage()
public MetricDescriptor.Builder clearLaunchStage()
Optional. The launch stage of the metric definition.
.google.api.LaunchStage launch_stage = 12;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clearMetadata()
public MetricDescriptor.Builder clearMetadata()
Optional. Metadata which can be used to guide usage of the metric.
.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
clearMetricKind()
public MetricDescriptor.Builder clearMetricKind()
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;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clearMonitoredResourceTypes()
public MetricDescriptor.Builder clearMonitoredResourceTypes()
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clearName()
public MetricDescriptor.Builder clearName()
The resource name of the metric descriptor.
string name = 1;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public MetricDescriptor.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter | |
---|---|
Name | Description |
oneof |
OneofDescriptor |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
clearType()
public MetricDescriptor.Builder clearType()
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;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clearUnit()
public MetricDescriptor.Builder clearUnit()
The units in which the metric value is reported. It is only applicable
if the value_type
is INT64
, DOUBLE
, or DISTRIBUTION
. The unit
defines the representation of the stored metric values.
Different systems might scale the values to be more easily displayed (so a
value of 0.02kBy
might be displayed as 20By
, and a value of
3523kBy
might be displayed as 3.5MBy
). However, if the unit
is
kBy
, then the value of the metric is always in thousands of bytes, no
matter how it might be displayed.
If you want a custom metric to record the exact number of CPU-seconds used
by a job, you can create an INT64 CUMULATIVE
metric whose unit
is
s{CPU}
(or equivalently 1s{CPU}
or just s
). If the job uses 12,005
CPU-seconds, then the value is written as 12005
.
Alternatively, if you want a custom metric to record data in a more
granular way, you can create a DOUBLE CUMULATIVE
metric whose unit
is
ks{CPU}
, and then write the value 12.005
(which is 12005/1000
),
or use Kis{CPU}
and write 11.723
(which is 12005/1024
).
The supported units are a subset of The Unified Code for Units of Measure standard:
Basic units (UNIT)
bit
bitBy
bytes
secondmin
minuteh
hourd
day1
dimensionlessPrefixes (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)Pi
pebi (2^50)Grammar
The grammar also includes these connectors:
/
division or ratio (as an infix operator). For examples,kBy/{email}
orMiBy/10ms
(although you should almost never have/s
in a metricunit
; rates should always be computed at query time from the underlying cumulative or delta value)..
multiplication or composition (as an infix operator). For examples,GBy.d
ork{watt}.h
.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 aUNIT
. If the annotation is used alone, then the unit is equivalent to1
. For examples,{request}/s == 1/s
,By{transmitted}/s == By/s
.NAME
is a sequence of non-blank printable ASCII characters not containing{
or}
.1
represents a unitary dimensionless unit of 1, such as in1/s
. It is typically used when none of the basic units are appropriate. For example, "new users per day" can be represented as1/d
or{new-users}/d
(and a metric value5
would mean "5 new users). Alternatively, "thousands of page views per day" would be represented as1000/d
ork1/d
ork{page_views}/d
(and a metric value of5.3
would mean "5300 page views per day").%
represents dimensionless value of 1/100, and annotates values giving a percentage (so the metric values are typically in the range of 0..100, and a metric value3
means "3 percent").10^2.%
indicates a metric contains a ratio, typically in the range 0..1, that will be multiplied by 100 and displayed as a percentage (so a metric value0.03
means "3 percent").
string unit = 5;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clearValueType()
public MetricDescriptor.Builder clearValueType()
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;
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
clone()
public MetricDescriptor.Builder clone()
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
getDefaultInstanceForType()
public MetricDescriptor getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
MetricDescriptor |
getDescription()
public String getDescription()
A detailed description of the metric, which can be used in documentation.
string description = 6;
Returns | |
---|---|
Type | Description |
String |
The description. |
getDescriptionBytes()
public ByteString getDescriptionBytes()
A detailed description of the metric, which can be used in documentation.
string description = 6;
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for description. |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns | |
---|---|
Type | Description |
Descriptor |
getDisplayName()
public String getDisplayName()
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;
Returns | |
---|---|
Type | Description |
String |
The displayName. |
getDisplayNameBytes()
public ByteString getDisplayNameBytes()
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;
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for displayName. |
getLabels(int index)
public LabelDescriptor getLabels(int 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;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
LabelDescriptor |
getLabelsBuilder(int index)
public LabelDescriptor.Builder getLabelsBuilder(int 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;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
LabelDescriptor.Builder |
getLabelsBuilderList()
public List<LabelDescriptor.Builder> getLabelsBuilderList()
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;
Returns | |
---|---|
Type | Description |
List<Builder> |
getLabelsCount()
public int getLabelsCount()
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;
Returns | |
---|---|
Type | Description |
int |
getLabelsList()
public List<LabelDescriptor> getLabelsList()
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;
Returns | |
---|---|
Type | Description |
List<LabelDescriptor> |
getLabelsOrBuilder(int index)
public LabelDescriptorOrBuilder getLabelsOrBuilder(int 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;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
LabelDescriptorOrBuilder |
getLabelsOrBuilderList()
public List<? extends LabelDescriptorOrBuilder> getLabelsOrBuilderList()
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;
Returns | |
---|---|
Type | Description |
List<? extends com.google.api.LabelDescriptorOrBuilder> |
getLaunchStage()
public LaunchStage getLaunchStage()
Optional. The launch stage of the metric definition.
.google.api.LaunchStage launch_stage = 12;
Returns | |
---|---|
Type | Description |
LaunchStage |
The launchStage. |
getLaunchStageValue()
public int getLaunchStageValue()
Optional. The launch stage of the metric definition.
.google.api.LaunchStage launch_stage = 12;
Returns | |
---|---|
Type | Description |
int |
The enum numeric value on the wire for launchStage. |
getMetadata()
public MetricDescriptor.MetricDescriptorMetadata getMetadata()
Optional. Metadata which can be used to guide usage of the metric.
.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
Returns | |
---|---|
Type | Description |
MetricDescriptor.MetricDescriptorMetadata |
The metadata. |
getMetadataBuilder()
public MetricDescriptor.MetricDescriptorMetadata.Builder getMetadataBuilder()
Optional. Metadata which can be used to guide usage of the metric.
.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
Returns | |
---|---|
Type | Description |
MetricDescriptor.MetricDescriptorMetadata.Builder |
getMetadataOrBuilder()
public MetricDescriptor.MetricDescriptorMetadataOrBuilder getMetadataOrBuilder()
Optional. Metadata which can be used to guide usage of the metric.
.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
Returns | |
---|---|
Type | Description |
MetricDescriptor.MetricDescriptorMetadataOrBuilder |
getMetricKind()
public MetricDescriptor.MetricKind getMetricKind()
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;
Returns | |
---|---|
Type | Description |
MetricDescriptor.MetricKind |
The metricKind. |
getMetricKindValue()
public int getMetricKindValue()
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;
Returns | |
---|---|
Type | Description |
int |
The enum numeric value on the wire for metricKind. |
getMonitoredResourceTypes(int index)
public String getMonitoredResourceTypes(int index)
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Parameter | |
---|---|
Name | Description |
index |
int The index of the element to return. |
Returns | |
---|---|
Type | Description |
String |
The monitoredResourceTypes at the given index. |
getMonitoredResourceTypesBytes(int index)
public ByteString getMonitoredResourceTypesBytes(int index)
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Parameter | |
---|---|
Name | Description |
index |
int The index of the value to return. |
Returns | |
---|---|
Type | Description |
ByteString |
The bytes of the monitoredResourceTypes at the given index. |
getMonitoredResourceTypesCount()
public int getMonitoredResourceTypesCount()
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Returns | |
---|---|
Type | Description |
int |
The count of monitoredResourceTypes. |
getMonitoredResourceTypesList()
public ProtocolStringList getMonitoredResourceTypesList()
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Returns | |
---|---|
Type | Description |
ProtocolStringList |
A list containing the monitoredResourceTypes. |
getName()
public String getName()
The resource name of the metric descriptor.
string name = 1;
Returns | |
---|---|
Type | Description |
String |
The name. |
getNameBytes()
public ByteString getNameBytes()
The resource name of the metric descriptor.
string name = 1;
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for name. |
getType()
public String getType()
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;
Returns | |
---|---|
Type | Description |
String |
The type. |
getTypeBytes()
public ByteString getTypeBytes()
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;
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for type. |
getUnit()
public String getUnit()
The units in which the metric value is reported. It is only applicable
if the value_type
is INT64
, DOUBLE
, or DISTRIBUTION
. The unit
defines the representation of the stored metric values.
Different systems might scale the values to be more easily displayed (so a
value of 0.02kBy
might be displayed as 20By
, and a value of
3523kBy
might be displayed as 3.5MBy
). However, if the unit
is
kBy
, then the value of the metric is always in thousands of bytes, no
matter how it might be displayed.
If you want a custom metric to record the exact number of CPU-seconds used
by a job, you can create an INT64 CUMULATIVE
metric whose unit
is
s{CPU}
(or equivalently 1s{CPU}
or just s
). If the job uses 12,005
CPU-seconds, then the value is written as 12005
.
Alternatively, if you want a custom metric to record data in a more
granular way, you can create a DOUBLE CUMULATIVE
metric whose unit
is
ks{CPU}
, and then write the value 12.005
(which is 12005/1000
),
or use Kis{CPU}
and write 11.723
(which is 12005/1024
).
The supported units are a subset of The Unified Code for Units of Measure standard:
Basic units (UNIT)
bit
bitBy
bytes
secondmin
minuteh
hourd
day1
dimensionlessPrefixes (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)Pi
pebi (2^50)Grammar
The grammar also includes these connectors:
/
division or ratio (as an infix operator). For examples,kBy/{email}
orMiBy/10ms
(although you should almost never have/s
in a metricunit
; rates should always be computed at query time from the underlying cumulative or delta value)..
multiplication or composition (as an infix operator). For examples,GBy.d
ork{watt}.h
.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 aUNIT
. If the annotation is used alone, then the unit is equivalent to1
. For examples,{request}/s == 1/s
,By{transmitted}/s == By/s
.NAME
is a sequence of non-blank printable ASCII characters not containing{
or}
.1
represents a unitary dimensionless unit of 1, such as in1/s
. It is typically used when none of the basic units are appropriate. For example, "new users per day" can be represented as1/d
or{new-users}/d
(and a metric value5
would mean "5 new users). Alternatively, "thousands of page views per day" would be represented as1000/d
ork1/d
ork{page_views}/d
(and a metric value of5.3
would mean "5300 page views per day").%
represents dimensionless value of 1/100, and annotates values giving a percentage (so the metric values are typically in the range of 0..100, and a metric value3
means "3 percent").10^2.%
indicates a metric contains a ratio, typically in the range 0..1, that will be multiplied by 100 and displayed as a percentage (so a metric value0.03
means "3 percent").
string unit = 5;
Returns | |
---|---|
Type | Description |
String |
The unit. |
getUnitBytes()
public ByteString getUnitBytes()
The units in which the metric value is reported. It is only applicable
if the value_type
is INT64
, DOUBLE
, or DISTRIBUTION
. The unit
defines the representation of the stored metric values.
Different systems might scale the values to be more easily displayed (so a
value of 0.02kBy
might be displayed as 20By
, and a value of
3523kBy
might be displayed as 3.5MBy
). However, if the unit
is
kBy
, then the value of the metric is always in thousands of bytes, no
matter how it might be displayed.
If you want a custom metric to record the exact number of CPU-seconds used
by a job, you can create an INT64 CUMULATIVE
metric whose unit
is
s{CPU}
(or equivalently 1s{CPU}
or just s
). If the job uses 12,005
CPU-seconds, then the value is written as 12005
.
Alternatively, if you want a custom metric to record data in a more
granular way, you can create a DOUBLE CUMULATIVE
metric whose unit
is
ks{CPU}
, and then write the value 12.005
(which is 12005/1000
),
or use Kis{CPU}
and write 11.723
(which is 12005/1024
).
The supported units are a subset of The Unified Code for Units of Measure standard:
Basic units (UNIT)
bit
bitBy
bytes
secondmin
minuteh
hourd
day1
dimensionlessPrefixes (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)Pi
pebi (2^50)Grammar
The grammar also includes these connectors:
/
division or ratio (as an infix operator). For examples,kBy/{email}
orMiBy/10ms
(although you should almost never have/s
in a metricunit
; rates should always be computed at query time from the underlying cumulative or delta value)..
multiplication or composition (as an infix operator). For examples,GBy.d
ork{watt}.h
.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 aUNIT
. If the annotation is used alone, then the unit is equivalent to1
. For examples,{request}/s == 1/s
,By{transmitted}/s == By/s
.NAME
is a sequence of non-blank printable ASCII characters not containing{
or}
.1
represents a unitary dimensionless unit of 1, such as in1/s
. It is typically used when none of the basic units are appropriate. For example, "new users per day" can be represented as1/d
or{new-users}/d
(and a metric value5
would mean "5 new users). Alternatively, "thousands of page views per day" would be represented as1000/d
ork1/d
ork{page_views}/d
(and a metric value of5.3
would mean "5300 page views per day").%
represents dimensionless value of 1/100, and annotates values giving a percentage (so the metric values are typically in the range of 0..100, and a metric value3
means "3 percent").10^2.%
indicates a metric contains a ratio, typically in the range 0..1, that will be multiplied by 100 and displayed as a percentage (so a metric value0.03
means "3 percent").
string unit = 5;
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for unit. |
getValueType()
public MetricDescriptor.ValueType getValueType()
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;
Returns | |
---|---|
Type | Description |
MetricDescriptor.ValueType |
The valueType. |
getValueTypeValue()
public int getValueTypeValue()
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;
Returns | |
---|---|
Type | Description |
int |
The enum numeric value on the wire for valueType. |
hasMetadata()
public boolean hasMetadata()
Optional. Metadata which can be used to guide usage of the metric.
.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
Returns | |
---|---|
Type | Description |
boolean |
Whether the metadata field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns | |
---|---|
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
mergeFrom(MetricDescriptor other)
public MetricDescriptor.Builder mergeFrom(MetricDescriptor other)
Parameter | |
---|---|
Name | Description |
other |
MetricDescriptor |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public MetricDescriptor.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters | |
---|---|
Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public MetricDescriptor.Builder mergeFrom(Message other)
Parameter | |
---|---|
Name | Description |
other |
Message |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
mergeMetadata(MetricDescriptor.MetricDescriptorMetadata value)
public MetricDescriptor.Builder mergeMetadata(MetricDescriptor.MetricDescriptorMetadata value)
Optional. Metadata which can be used to guide usage of the metric.
.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
Parameter | |
---|---|
Name | Description |
value |
MetricDescriptor.MetricDescriptorMetadata |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final MetricDescriptor.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
removeLabels(int index)
public MetricDescriptor.Builder removeLabels(int 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;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
setDescription(String value)
public MetricDescriptor.Builder setDescription(String value)
A detailed description of the metric, which can be used in documentation.
string description = 6;
Parameter | |
---|---|
Name | Description |
value |
String The description to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setDescriptionBytes(ByteString value)
public MetricDescriptor.Builder setDescriptionBytes(ByteString value)
A detailed description of the metric, which can be used in documentation.
string description = 6;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for description to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setDisplayName(String value)
public MetricDescriptor.Builder setDisplayName(String value)
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;
Parameter | |
---|---|
Name | Description |
value |
String The displayName to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setDisplayNameBytes(ByteString value)
public MetricDescriptor.Builder setDisplayNameBytes(ByteString value)
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;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for displayName to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
public MetricDescriptor.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
setLabels(int index, LabelDescriptor value)
public MetricDescriptor.Builder setLabels(int index, LabelDescriptor value)
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;
Parameters | |
---|---|
Name | Description |
index |
int |
value |
LabelDescriptor |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
setLabels(int index, LabelDescriptor.Builder builderForValue)
public MetricDescriptor.Builder setLabels(int index, LabelDescriptor.Builder builderForValue)
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;
Parameters | |
---|---|
Name | Description |
index |
int |
builderForValue |
LabelDescriptor.Builder |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
setLaunchStage(LaunchStage value)
public MetricDescriptor.Builder setLaunchStage(LaunchStage value)
Optional. The launch stage of the metric definition.
.google.api.LaunchStage launch_stage = 12;
Parameter | |
---|---|
Name | Description |
value |
LaunchStage The launchStage to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setLaunchStageValue(int value)
public MetricDescriptor.Builder setLaunchStageValue(int value)
Optional. The launch stage of the metric definition.
.google.api.LaunchStage launch_stage = 12;
Parameter | |
---|---|
Name | Description |
value |
int The enum numeric value on the wire for launchStage to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setMetadata(MetricDescriptor.MetricDescriptorMetadata value)
public MetricDescriptor.Builder setMetadata(MetricDescriptor.MetricDescriptorMetadata value)
Optional. Metadata which can be used to guide usage of the metric.
.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
Parameter | |
---|---|
Name | Description |
value |
MetricDescriptor.MetricDescriptorMetadata |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
setMetadata(MetricDescriptor.MetricDescriptorMetadata.Builder builderForValue)
public MetricDescriptor.Builder setMetadata(MetricDescriptor.MetricDescriptorMetadata.Builder builderForValue)
Optional. Metadata which can be used to guide usage of the metric.
.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;
Parameter | |
---|---|
Name | Description |
builderForValue |
MetricDescriptor.MetricDescriptorMetadata.Builder |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
setMetricKind(MetricDescriptor.MetricKind value)
public MetricDescriptor.Builder setMetricKind(MetricDescriptor.MetricKind value)
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;
Parameter | |
---|---|
Name | Description |
value |
MetricDescriptor.MetricKind The metricKind to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setMetricKindValue(int value)
public MetricDescriptor.Builder setMetricKindValue(int value)
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;
Parameter | |
---|---|
Name | Description |
value |
int The enum numeric value on the wire for metricKind to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setMonitoredResourceTypes(int index, String value)
public MetricDescriptor.Builder setMonitoredResourceTypes(int index, String value)
Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.
repeated string monitored_resource_types = 13;
Parameters | |
---|---|
Name | Description |
index |
int The index to set the value at. |
value |
String The monitoredResourceTypes to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setName(String value)
public MetricDescriptor.Builder setName(String value)
The resource name of the metric descriptor.
string name = 1;
Parameter | |
---|---|
Name | Description |
value |
String The name to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setNameBytes(ByteString value)
public MetricDescriptor.Builder setNameBytes(ByteString value)
The resource name of the metric descriptor.
string name = 1;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for name to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public MetricDescriptor.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
index |
int |
value |
Object |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
setType(String value)
public MetricDescriptor.Builder setType(String value)
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;
Parameter | |
---|---|
Name | Description |
value |
String The type to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setTypeBytes(ByteString value)
public MetricDescriptor.Builder setTypeBytes(ByteString value)
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;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for type to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setUnit(String value)
public MetricDescriptor.Builder setUnit(String value)
The units in which the metric value is reported. It is only applicable
if the value_type
is INT64
, DOUBLE
, or DISTRIBUTION
. The unit
defines the representation of the stored metric values.
Different systems might scale the values to be more easily displayed (so a
value of 0.02kBy
might be displayed as 20By
, and a value of
3523kBy
might be displayed as 3.5MBy
). However, if the unit
is
kBy
, then the value of the metric is always in thousands of bytes, no
matter how it might be displayed.
If you want a custom metric to record the exact number of CPU-seconds used
by a job, you can create an INT64 CUMULATIVE
metric whose unit
is
s{CPU}
(or equivalently 1s{CPU}
or just s
). If the job uses 12,005
CPU-seconds, then the value is written as 12005
.
Alternatively, if you want a custom metric to record data in a more
granular way, you can create a DOUBLE CUMULATIVE
metric whose unit
is
ks{CPU}
, and then write the value 12.005
(which is 12005/1000
),
or use Kis{CPU}
and write 11.723
(which is 12005/1024
).
The supported units are a subset of The Unified Code for Units of Measure standard:
Basic units (UNIT)
bit
bitBy
bytes
secondmin
minuteh
hourd
day1
dimensionlessPrefixes (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)Pi
pebi (2^50)Grammar
The grammar also includes these connectors:
/
division or ratio (as an infix operator). For examples,kBy/{email}
orMiBy/10ms
(although you should almost never have/s
in a metricunit
; rates should always be computed at query time from the underlying cumulative or delta value)..
multiplication or composition (as an infix operator). For examples,GBy.d
ork{watt}.h
.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 aUNIT
. If the annotation is used alone, then the unit is equivalent to1
. For examples,{request}/s == 1/s
,By{transmitted}/s == By/s
.NAME
is a sequence of non-blank printable ASCII characters not containing{
or}
.1
represents a unitary dimensionless unit of 1, such as in1/s
. It is typically used when none of the basic units are appropriate. For example, "new users per day" can be represented as1/d
or{new-users}/d
(and a metric value5
would mean "5 new users). Alternatively, "thousands of page views per day" would be represented as1000/d
ork1/d
ork{page_views}/d
(and a metric value of5.3
would mean "5300 page views per day").%
represents dimensionless value of 1/100, and annotates values giving a percentage (so the metric values are typically in the range of 0..100, and a metric value3
means "3 percent").10^2.%
indicates a metric contains a ratio, typically in the range 0..1, that will be multiplied by 100 and displayed as a percentage (so a metric value0.03
means "3 percent").
string unit = 5;
Parameter | |
---|---|
Name | Description |
value |
String The unit to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setUnitBytes(ByteString value)
public MetricDescriptor.Builder setUnitBytes(ByteString value)
The units in which the metric value is reported. It is only applicable
if the value_type
is INT64
, DOUBLE
, or DISTRIBUTION
. The unit
defines the representation of the stored metric values.
Different systems might scale the values to be more easily displayed (so a
value of 0.02kBy
might be displayed as 20By
, and a value of
3523kBy
might be displayed as 3.5MBy
). However, if the unit
is
kBy
, then the value of the metric is always in thousands of bytes, no
matter how it might be displayed.
If you want a custom metric to record the exact number of CPU-seconds used
by a job, you can create an INT64 CUMULATIVE
metric whose unit
is
s{CPU}
(or equivalently 1s{CPU}
or just s
). If the job uses 12,005
CPU-seconds, then the value is written as 12005
.
Alternatively, if you want a custom metric to record data in a more
granular way, you can create a DOUBLE CUMULATIVE
metric whose unit
is
ks{CPU}
, and then write the value 12.005
(which is 12005/1000
),
or use Kis{CPU}
and write 11.723
(which is 12005/1024
).
The supported units are a subset of The Unified Code for Units of Measure standard:
Basic units (UNIT)
bit
bitBy
bytes
secondmin
minuteh
hourd
day1
dimensionlessPrefixes (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)Pi
pebi (2^50)Grammar
The grammar also includes these connectors:
/
division or ratio (as an infix operator). For examples,kBy/{email}
orMiBy/10ms
(although you should almost never have/s
in a metricunit
; rates should always be computed at query time from the underlying cumulative or delta value)..
multiplication or composition (as an infix operator). For examples,GBy.d
ork{watt}.h
.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 aUNIT
. If the annotation is used alone, then the unit is equivalent to1
. For examples,{request}/s == 1/s
,By{transmitted}/s == By/s
.NAME
is a sequence of non-blank printable ASCII characters not containing{
or}
.1
represents a unitary dimensionless unit of 1, such as in1/s
. It is typically used when none of the basic units are appropriate. For example, "new users per day" can be represented as1/d
or{new-users}/d
(and a metric value5
would mean "5 new users). Alternatively, "thousands of page views per day" would be represented as1000/d
ork1/d
ork{page_views}/d
(and a metric value of5.3
would mean "5300 page views per day").%
represents dimensionless value of 1/100, and annotates values giving a percentage (so the metric values are typically in the range of 0..100, and a metric value3
means "3 percent").10^2.%
indicates a metric contains a ratio, typically in the range 0..1, that will be multiplied by 100 and displayed as a percentage (so a metric value0.03
means "3 percent").
string unit = 5;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for unit to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setUnknownFields(UnknownFieldSet unknownFields)
public final MetricDescriptor.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
setValueType(MetricDescriptor.ValueType value)
public MetricDescriptor.Builder setValueType(MetricDescriptor.ValueType value)
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;
Parameter | |
---|---|
Name | Description |
value |
MetricDescriptor.ValueType The valueType to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |
setValueTypeValue(int value)
public MetricDescriptor.Builder setValueTypeValue(int value)
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;
Parameter | |
---|---|
Name | Description |
value |
int The enum numeric value on the wire for valueType to set. |
Returns | |
---|---|
Type | Description |
MetricDescriptor.Builder |
This builder for chaining. |