Skip to content

Commit

Permalink
Merge branch '7.0.x' into 7.1.x by ericwush
Browse files Browse the repository at this point in the history
  • Loading branch information
ConfluentJenkins committed Sep 6, 2022
2 parents b82cffa + 9d9744e commit 14e44da
Showing 1 changed file with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,10 @@
import org.apache.kafka.common.metrics.MeasurableStat;
import org.apache.kafka.common.metrics.Metrics;
import org.apache.kafka.common.metrics.Sensor;
import org.apache.kafka.common.metrics.stats.Value;

import java.util.concurrent.atomic.AtomicLong;

public class SchemaRegistryMetric {
@Deprecated
private final AtomicLong count = new AtomicLong();
private final Sensor sensor;

@Deprecated
public SchemaRegistryMetric(Metrics metrics, String sensorName, MetricName metricName) {
this(metrics, sensorName, metricName, new Value());
}

public SchemaRegistryMetric(Metrics metrics, String sensorName, MetricName metricName,
MeasurableStat measurableStat) {
// a new sensor is only created if the sensor name doesn't already exist in metrics
Expand All @@ -41,22 +31,6 @@ public SchemaRegistryMetric(Metrics metrics, String sensorName, MetricName metri
sensor.add(metricName, measurableStat);
}

@Deprecated
public void increment() {
sensor.record(count.addAndGet(1));
}

@Deprecated
public void set(long value) {
count.set(value);
sensor.record(value);
}

@Deprecated
public long get() {
return count.get();
}

public void record() {
// equivalent to record(1.0);
sensor.record();
Expand Down

0 comments on commit 14e44da

Please sign in to comment.