Package io.grpc
Class PartialMetricInstrument
java.lang.Object
io.grpc.PartialMetricInstrument
- All Implemented Interfaces:
MetricInstrument
- Direct Known Subclasses:
DoubleCounterMetricInstrument,DoubleHistogramMetricInstrument,LongCounterMetricInstrument,LongGaugeMetricInstrument,LongHistogramMetricInstrument
A partial implementation of the
MetricInstrument interface. This class
provides common fields and functionality for metric instruments.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a description of the metric.intgetIndex()Returns the unique index of this metric instrument.getName()Returns the name of the metric.Returns a list of optional label keys for this metric instrument.Returns a list of required label keys for this metric instrument.getUnit()Returns the unit of measurement for the metric.booleanIndicates whether this metric instrument is enabled by default.toString()
-
Field Details
-
index
protected final int index -
name
-
description
-
unit
-
requiredLabelKeys
-
optionalLabelKeys
-
enableByDefault
protected final boolean enableByDefault
-
-
Constructor Details
-
PartialMetricInstrument
protected PartialMetricInstrument(int index, String name, String description, String unit, List<String> requiredLabelKeys, List<String> optionalLabelKeys, boolean enableByDefault) Constructs a new PartialMetricInstrument with the specified attributes.- Parameters:
index- the unique index of this metric instrumentname- the name of the metricdescription- a description of the metricunit- the unit of measurement for the metricrequiredLabelKeys- a list of required label keys for the metricoptionalLabelKeys- a list of optional label keys for the metricenableByDefault- whether the metric should be enabled by default
-
-
Method Details
-
getIndex
public int getIndex()Description copied from interface:MetricInstrumentReturns the unique index of this metric instrument.- Specified by:
getIndexin interfaceMetricInstrument- Returns:
- the index of the metric instrument.
-
getName
Description copied from interface:MetricInstrumentReturns the name of the metric.- Specified by:
getNamein interfaceMetricInstrument- Returns:
- the name of the metric.
-
getDescription
Description copied from interface:MetricInstrumentReturns a description of the metric.- Specified by:
getDescriptionin interfaceMetricInstrument- Returns:
- a description of the metric.
-
getUnit
Description copied from interface:MetricInstrumentReturns the unit of measurement for the metric.- Specified by:
getUnitin interfaceMetricInstrument- Returns:
- the unit of measurement.
-
getRequiredLabelKeys
Description copied from interface:MetricInstrumentReturns a list of required label keys for this metric instrument.- Specified by:
getRequiredLabelKeysin interfaceMetricInstrument- Returns:
- a list of required label keys.
-
getOptionalLabelKeys
Description copied from interface:MetricInstrumentReturns a list of optional label keys for this metric instrument.- Specified by:
getOptionalLabelKeysin interfaceMetricInstrument- Returns:
- a list of optional label keys.
-
isEnableByDefault
public boolean isEnableByDefault()Description copied from interface:MetricInstrumentIndicates whether this metric instrument is enabled by default.- Specified by:
isEnableByDefaultin interfaceMetricInstrument- Returns:
trueif this metric instrument is enabled by default,falseotherwise.
-
toString
-