Package io.opencensus.metrics
Class MetricOptions.Builder
- java.lang.Object
-
- io.opencensus.metrics.MetricOptions.Builder
-
- Direct Known Subclasses:
AutoValue_MetricOptions.Builder
- Enclosing class:
- MetricOptions
public abstract static class MetricOptions.Builder extends java.lang.ObjectBuilder forMetricOptions.- Since:
- 0.20
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract MetricOptionsautoBuild()MetricOptionsbuild()Builds and returns aMetricOptionswith the desired options.(package private) abstract java.util.Map<LabelKey,LabelValue>getConstantLabels()(package private) abstract java.util.List<LabelKey>getLabelKeys()abstract MetricOptions.BuildersetConstantLabels(java.util.Map<LabelKey,LabelValue> constantLabels)Sets the map of constant labels (they will be added to all the TimeSeries) for the Metric.abstract MetricOptions.BuildersetDescription(java.lang.String description)Sets the description of the Metric.abstract MetricOptions.BuildersetLabelKeys(java.util.List<LabelKey> labelKeys)Sets the list of label keys for the Metric.abstract MetricOptions.BuildersetUnit(java.lang.String unit)Sets the unit of the Metric.
-
-
-
Method Detail
-
setDescription
public abstract MetricOptions.Builder setDescription(java.lang.String description)
Sets the description of the Metric.- Parameters:
description- the description of the Metric.- Returns:
- this.
- Since:
- 0.20
-
setUnit
public abstract MetricOptions.Builder setUnit(java.lang.String unit)
Sets the unit of the Metric.- Parameters:
unit- the unit of the Metric.- Returns:
- this.
- Since:
- 0.20
-
setLabelKeys
public abstract MetricOptions.Builder setLabelKeys(java.util.List<LabelKey> labelKeys)
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
public abstract MetricOptions.Builder setConstantLabels(java.util.Map<LabelKey,LabelValue> constantLabels)
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
abstract java.util.Map<LabelKey,LabelValue> getConstantLabels()
-
getLabelKeys
abstract java.util.List<LabelKey> getLabelKeys()
-
autoBuild
abstract MetricOptions autoBuild()
-
build
public MetricOptions build()
Builds and returns aMetricOptionswith the desired options.- Returns:
- a
MetricOptionswith the desired options. - Throws:
java.lang.NullPointerException- ifdescription, ORunitis null, ORlabelKeysis null OR any element oflabelKeysis null, OR ORconstantLabelsis null OR any element ofconstantLabelsis null.java.lang.IllegalArgumentException- if anyLabelKeyfrom thelabelKeysis in theconstantLabels.- Since:
- 0.20
-
-