Class MetricOptions.Builder
java.lang.Object
io.opencensus.metrics.MetricOptions.Builder
- Direct Known Subclasses:
AutoValue_MetricOptions.Builder
- Enclosing class:
MetricOptions
Builder for
MetricOptions.- Since:
- 0.20
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract MetricOptionsbuild()Builds and returns aMetricOptionswith the desired options.(package private) abstract Map<LabelKey, LabelValue> abstract MetricOptions.BuildersetConstantLabels(Map<LabelKey, LabelValue> constantLabels) Sets the map of constant labels (they will be added to all the TimeSeries) for the Metric.abstract MetricOptions.BuildersetDescription(String description) Sets the description of the Metric.abstract MetricOptions.BuildersetLabelKeys(List<LabelKey> labelKeys) Sets the list of label keys for the Metric.abstract MetricOptions.BuilderSets the unit of the Metric.
-
Constructor Details
-
Builder
Builder()
-
-
Method Details
-
setDescription
Sets the description of the Metric.- Parameters:
description- the description of the Metric.- Returns:
- this.
- Since:
- 0.20
-
setUnit
Sets the unit of the Metric.- Parameters:
unit- the unit of the Metric.- Returns:
- this.
- Since:
- 0.20
-
setLabelKeys
Sets the list of label keys for the Metric.- Parameters:
labelKeys- the list of label keys for the Metric.- Returns:
- this.
- Since:
- 0.20
-
setConstantLabels
Sets the map of constant labels (they will be added to all the TimeSeries) for the Metric.- Parameters:
constantLabels- the map of constant labels for the Metric.- Returns:
- this.
- Since:
- 0.21
-
getConstantLabels
-
getLabelKeys
-
autoBuild
-
build
Builds and returns aMetricOptionswith the desired options.- Returns:
- a
MetricOptionswith the desired options. - Throws:
NullPointerException- ifdescription, ORunitis null, ORlabelKeysis null OR any element oflabelKeysis null, OR ORconstantLabelsis null OR any element ofconstantLabelsis null.IllegalArgumentException- if anyLabelKeyfrom thelabelKeysis in theconstantLabels.- Since:
- 0.20
-