diff --git a/sentry/api/sentry.api b/sentry/api/sentry.api index ed00493135..bcfc1c9194 100644 --- a/sentry/api/sentry.api +++ b/sentry/api/sentry.api @@ -3479,16 +3479,6 @@ public abstract class io/sentry/metrics/Metric { public abstract fun serialize ()Ljava/lang/Iterable; } -public final class io/sentry/metrics/MetricResourceIdentifier { - public fun (Lio/sentry/metrics/MetricType;Ljava/lang/String;Lio/sentry/MeasurementUnit;)V - public fun equals (Ljava/lang/Object;)Z - public fun getKey ()Ljava/lang/String; - public fun getMetricType ()Lio/sentry/metrics/MetricType; - public fun getUnit ()Lio/sentry/MeasurementUnit; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - public final class io/sentry/metrics/MetricType : java/lang/Enum { public static final field Counter Lio/sentry/metrics/MetricType; public static final field Distribution Lio/sentry/metrics/MetricType; diff --git a/sentry/src/main/java/io/sentry/metrics/MetricResourceIdentifier.java b/sentry/src/main/java/io/sentry/metrics/MetricResourceIdentifier.java deleted file mode 100644 index 7aebd4f010..0000000000 --- a/sentry/src/main/java/io/sentry/metrics/MetricResourceIdentifier.java +++ /dev/null @@ -1,64 +0,0 @@ -package io.sentry.metrics; - -import io.sentry.MeasurementUnit; -import io.sentry.util.Objects; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * Uniquely identifies a metric resource. Used for caching the {@link CodeLocations} for a given - * metric. - */ -@ApiStatus.Internal -public final class MetricResourceIdentifier { - private final @NotNull MetricType metricType; - private final @NotNull String key; - private final @Nullable MeasurementUnit unit; - - public MetricResourceIdentifier( - final @NotNull MetricType metricType, - final @NotNull String key, - final @Nullable MeasurementUnit unit) { - this.metricType = metricType; - this.key = key; - this.unit = unit; - } - - @NotNull - public MetricType getMetricType() { - return metricType; - } - - @NotNull - public String getKey() { - return key; - } - - @Nullable - public MeasurementUnit getUnit() { - return unit; - } - - /** Returns a string representation of the metric resource identifier. */ - @Override - public String toString() { - return String.format( - "%s:%s@%s", MetricsHelper.toStatsdType(metricType), MetricsHelper.sanitizeKey(key), unit); - } - - @Override - public boolean equals(@Nullable Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - final @NotNull MetricResourceIdentifier that = (MetricResourceIdentifier) o; - return metricType == that.metricType - && Objects.equals(key, that.key) - && Objects.equals(unit, that.unit); - } - - @Override - public int hashCode() { - return Objects.hash(metricType, key, unit); - } -}