Package io.sentry
Interface IMetricsAggregator
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
MetricsAggregator,NoopMetricsAggregator
-
Method Summary
Modifier and TypeMethodDescriptionvoiddistribution(@NotNull String key, double value, @Nullable MeasurementUnit unit, @Nullable Map<String, String> tags, long timestampMs, @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Distribution metricvoidflush(boolean force) voidgauge(@NotNull String key, double value, @Nullable MeasurementUnit unit, @Nullable Map<String, String> tags, long timestampMs, @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Gauge metricvoidincrement(@NotNull String key, double value, @Nullable MeasurementUnit unit, @Nullable Map<String, String> tags, long timestampMs, @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Counter metricvoidset(@NotNull String key, int value, @Nullable MeasurementUnit unit, @Nullable Map<String, String> tags, long timestampMs, @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Set metricvoidset(@NotNull String key, @NotNull String value, @Nullable MeasurementUnit unit, @Nullable Map<String, String> tags, long timestampMs, @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Set metricvoidtiming(@NotNull String key, @NotNull Runnable callback, MeasurementUnit.Duration unit, @Nullable Map<String, String> tags, @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a distribution with the time it takes to run a given code block.
-
Method Details
-
increment
void increment(@NotNull @NotNull String key, double value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String, String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Counter metric- Parameters:
key- A unique key identifying the metricvalue- The value to be addedunit- An optional unit, seeMeasurementUnittags- Optional Tags to associate with the metrictimestampMs- The time when the metric was emitted. Defaults to the time at which the metric is emitted, if no value is provided.localMetricsAggregator- The local metrics aggregator for creating span summaries
-
gauge
void gauge(@NotNull @NotNull String key, double value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String, String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Gauge metric- Parameters:
key- A unique key identifying the metricvalue- The value to be addedunit- An optional unit, seeMeasurementUnittags- Optional Tags to associate with the metrictimestampMs- The time when the metric was emitted. Defaults to the time at which the metric is emitted, if no value is provided.localMetricsAggregator- The local metrics aggregator for creating span summaries
-
distribution
void distribution(@NotNull @NotNull String key, double value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String, String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Distribution metric- Parameters:
key- A unique key identifying the metricvalue- The value to be addedunit- An optional unit, seeMeasurementUnittags- Optional Tags to associate with the metrictimestampMs- The time when the metric was emitted. Defaults to the time at which the metric is emitted, if no value is provided.localMetricsAggregator- The local metrics aggregator for creating span summaries
-
set
void set(@NotNull @NotNull String key, int value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String, String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Set metric- Parameters:
key- A unique key identifying the metricvalue- The value to be addedunit- An optional unit, seeMeasurementUnittags- Optional Tags to associate with the metrictimestampMs- The time when the metric was emitted. Defaults to the time at which the metric is emitted, if no value is provided.localMetricsAggregator- The local metrics aggregator for creating span summaries
-
set
void set(@NotNull @NotNull String key, @NotNull @NotNull String value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String, String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a Set metric- Parameters:
key- A unique key identifying the metricvalue- The value to be addedunit- An optional unit, seeMeasurementUnittags- Optional Tags to associate with the metrictimestampMs- The time when the metric was emitted. Defaults to the time at which the metric is emitted, if no value is provided.localMetricsAggregator- The local metrics aggregator for creating span summaries
-
timing
void timing(@NotNull @NotNull String key, @NotNull @NotNull Runnable callback, @NotNull MeasurementUnit.Duration unit, @Nullable @Nullable Map<String, String> tags, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator) Emits a distribution with the time it takes to run a given code block.- Parameters:
key- A unique key identifying the metriccallback- The code block to measureunit- An optional unit, seeMeasurementUnit.Duration, defaults to secondstags- Optional Tags to associate with the metriclocalMetricsAggregator- The local metrics aggregator for creating span summaries
-
flush
void flush(boolean force)
-