Package io.sentry

Class MetricsAggregator

java.lang.Object
io.sentry.MetricsAggregator
All Implemented Interfaces:
IMetricsAggregator, Closeable, AutoCloseable, Runnable

@Internal public final class MetricsAggregator extends Object implements IMetricsAggregator, Runnable, Closeable
  • Constructor Details

  • Method Details

    • increment

      public void increment(@NotNull @NotNull String key, double value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String,String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator)
      Description copied from interface: IMetricsAggregator
      Emits a Counter metric
      Specified by:
      increment in interface IMetricsAggregator
      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

      public void gauge(@NotNull @NotNull String key, double value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String,String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator)
      Description copied from interface: IMetricsAggregator
      Emits a Gauge metric
      Specified by:
      gauge in interface IMetricsAggregator
      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

      public void distribution(@NotNull @NotNull String key, double value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String,String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator)
      Description copied from interface: IMetricsAggregator
      Emits a Distribution metric
      Specified by:
      distribution in interface IMetricsAggregator
      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

      public void set(@NotNull @NotNull String key, int value, @Nullable @Nullable MeasurementUnit unit, @Nullable @Nullable Map<String,String> tags, long timestampMs, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator)
      Description copied from interface: IMetricsAggregator
      Emits a Set metric
      Specified by:
      set in interface IMetricsAggregator
      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

      public 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)
      Description copied from interface: IMetricsAggregator
      Emits a Set metric
      Specified by:
      set in interface IMetricsAggregator
      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
    • flush

      public void flush(boolean force)
      Specified by:
      flush in interface IMetricsAggregator
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • run

      public void run()
      Specified by:
      run in interface Runnable