Class NoopMetricsAggregator

java.lang.Object
io.sentry.metrics.NoopMetricsAggregator
All Implemented Interfaces:
IMetricsAggregator, MetricsApi.IMetricsInterface, Closeable, AutoCloseable

@Internal public final class NoopMetricsAggregator extends Object implements IMetricsAggregator, MetricsApi.IMetricsInterface
  • Constructor Details

    • NoopMetricsAggregator

      public NoopMetricsAggregator()
  • Method Details

    • getInstance

      public static NoopMetricsAggregator getInstance()
    • 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
    • timing

      public void timing(@NotNull @NotNull String key, @NotNull @NotNull Runnable callback, @NotNull MeasurementUnit.Duration unit, @Nullable @Nullable Map<String,String> tags, @Nullable @Nullable LocalMetricsAggregator localMetricsAggregator)
      Description copied from interface: IMetricsAggregator
      Emits a distribution with the time it takes to run a given code block.
      Specified by:
      timing in interface IMetricsAggregator
      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

      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
    • getMetricsAggregator

      @NotNull public @NotNull IMetricsAggregator getMetricsAggregator()
      Specified by:
      getMetricsAggregator in interface MetricsApi.IMetricsInterface
    • getLocalMetricsAggregator

      @Nullable public @Nullable LocalMetricsAggregator getLocalMetricsAggregator()
      Specified by:
      getLocalMetricsAggregator in interface MetricsApi.IMetricsInterface
    • getDefaultTagsForMetrics

      @NotNull public @NotNull Map<String,String> getDefaultTagsForMetrics()
      Specified by:
      getDefaultTagsForMetrics in interface MetricsApi.IMetricsInterface
    • startSpanForMetric

      @Nullable public @Nullable ISpan startSpanForMetric(@NotNull @NotNull String op, @NotNull @NotNull String description)
      Specified by:
      startSpanForMetric in interface MetricsApi.IMetricsInterface