Package io.opencensus.metrics
Class MetricOptions
- java.lang.Object
-
- io.opencensus.metrics.MetricOptions
-
- Direct Known Subclasses:
AutoValue_MetricOptions
@Immutable public abstract class MetricOptions extends java.lang.Object
Options for every metric added to theMetricRegistry
.- Since:
- 0.20
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetricOptions.Builder
Builder forMetricOptions
.
-
Constructor Summary
Constructors Constructor Description MetricOptions()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MetricOptions.Builder
builder()
Returns a newMetricOptions.Builder
with default options.abstract java.util.Map<LabelKey,LabelValue>
getConstantLabels()
Returns the map of constant labels (they will be added to all the TimeSeries) for the Metric.abstract java.lang.String
getDescription()
Returns the description of the Metric.abstract java.util.List<LabelKey>
getLabelKeys()
Returns the list of label keys for the Metric.abstract java.lang.String
getUnit()
Returns the unit of the Metric.
-
-
-
Method Detail
-
getDescription
public abstract java.lang.String getDescription()
Returns the description of the Metric.Default value is
""
.- Returns:
- the description of the Metric.
- Since:
- 0.20
-
getUnit
public abstract java.lang.String getUnit()
Returns the unit of the Metric.Default value is
"1"
.- Returns:
- the unit of the Metric.
- Since:
- 0.20
-
getLabelKeys
public abstract java.util.List<LabelKey> getLabelKeys()
Returns the list of label keys for the Metric.Default value is
Collections.emptyList()
.- Returns:
- the list of label keys for the Metric.
- Since:
- 0.20
-
getConstantLabels
public abstract java.util.Map<LabelKey,LabelValue> getConstantLabels()
Returns the map of constant labels (they will be added to all the TimeSeries) for the Metric.Default value is
Collections.emptyMap()
.- Returns:
- the map of constant labels for the Metric.
- Since:
- 0.21
-
builder
public static MetricOptions.Builder builder()
Returns a newMetricOptions.Builder
with default options.- Returns:
- a new
Builder
with default options. - Since:
- 0.20.0
-
-