Skip to content

Commit

Permalink
[fix][metrics] fixed ProxyStats to use common.stats.JvmMetrics (apach…
Browse files Browse the repository at this point in the history
…e#15692)

Co-authored-by: Matteo Merli <[email protected]>
  • Loading branch information
heesung-sn and merlimat authored Jun 7, 2022
1 parent 9cca2fe commit 7eeeba1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 128 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.apache.pulsar.common.naming.TopicName;
import org.apache.pulsar.common.stats.JvmMetrics;
import org.apache.pulsar.common.stats.Metrics;
import org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap;
import org.apache.pulsar.websocket.WebSocketService;
Expand All @@ -47,7 +48,8 @@ public class ProxyStats {
public ProxyStats(WebSocketService service) {
super();
this.service = service;
this.jvmMetrics = new JvmMetrics(service);
this.jvmMetrics = JvmMetrics.create(
service.getExecutor(), "prx", service.getConfig().getJvmGCMetricsLoggerClassName());
this.topicStats =
ConcurrentOpenHashMap.<String, ProxyNamespaceStats>newBuilder()
.build();
Expand Down Expand Up @@ -109,7 +111,7 @@ public synchronized void generate() {
if (log.isDebugEnabled()) {
log.debug("Add jvm-stats to metrics");
}
tempMetricsCollection.add(jvmMetrics.generate());
tempMetricsCollection.add(jvmMetrics.generate().get(0));

// swap tempmetrics to stat-metrics
List<Metrics> tempRef = metricsCollection;
Expand Down

0 comments on commit 7eeeba1

Please sign in to comment.