Package io.sentry.metrics
Class Metric
java.lang.Object
io.sentry.metrics.Metric
- Direct Known Subclasses:
CounterMetric
,DistributionMetric
,GaugeMetric
,SetMetric
Base class for metric instruments
-
Constructor Summary
ConstructorDescriptionMetric
(@NotNull MetricType type, @NotNull String key, @Nullable MeasurementUnit unit, @Nullable Map<String, String> tags) Creates a new instance ofMetric
. -
Method Summary
-
Constructor Details
-
Metric
public Metric(@NotNull @NotNull MetricType type, @NotNull @NotNull String key, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String, String> tags) Creates a new instance ofMetric
.- Parameters:
key
- The text key to be used to identify the metricunit
- An optionalMeasurementUnit
that describes the values being trackedtags
- An optional set of key/value pairs that can be used to add dimensionality to metrics
-
-
Method Details
-
add
public abstract void add(double value) Adds a value to the metric -
getType
-
getWeight
public abstract int getWeight() -
getKey
-
getUnit
-
getTags
-
serialize
-