Package io.sentry

Interface IMetricsAggregator

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
MetricsAggregator, NoopMetricsAggregator

public interface IMetricsAggregator extends Closeable
  • 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 metric
      value - The value to be added
      unit - An optional unit, see MeasurementUnit
      tags - Optional Tags to associate with the metric
      timestampMs - 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 metric
      value - The value to be added
      unit - An optional unit, see MeasurementUnit
      tags - Optional Tags to associate with the metric
      timestampMs - 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 metric
      value - The value to be added
      unit - An optional unit, see MeasurementUnit
      tags - Optional Tags to associate with the metric
      timestampMs - 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 metric
      value - The value to be added
      unit - An optional unit, see MeasurementUnit
      tags - Optional Tags to associate with the metric
      timestampMs - 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 metric
      value - The value to be added
      unit - An optional unit, see MeasurementUnit
      tags - Optional Tags to associate with the metric
      timestampMs - 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 metric
      callback - The code block to measure
      unit - An optional unit, see MeasurementUnit.Duration, defaults to seconds
      tags - Optional Tags to associate with the metric
      localMetricsAggregator - The local metrics aggregator for creating span summaries
    • flush

      void flush(boolean force)