Skip to content

Commit

Permalink
Remove internal Hotspot metrics (#1156)
Browse files Browse the repository at this point in the history
They're less of a concern for us now we're on ZGC, and most of the
critical work happens in thread local handshakes, not safepoints, and
JNI critical/GCLocker is less of a concern.
---------

Co-authored-by: brharrington <[email protected]>
  • Loading branch information
DanielThomas and brharrington authored Sep 4, 2024
1 parent bcdd2e5 commit d8bb9a8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 189 deletions.

This file was deleted.

29 changes: 0 additions & 29 deletions spectator-ext-jvm/src/main/java/com/netflix/spectator/jvm/Jmx.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.netflix.spectator.api.Gauge;
import com.netflix.spectator.api.Registry;
import com.netflix.spectator.api.Statistic;
import com.netflix.spectator.api.patterns.PolledMeter;
import com.typesafe.config.Config;

Expand Down Expand Up @@ -57,7 +56,6 @@ public static void registerStandardMXBeans(Registry registry) {
monitorThreadMXBean(registry);
monitorCompilationMXBean(registry);
}
maybeRegisterHotspotInternal(registry);

for (MemoryPoolMXBean mbean : ManagementFactory.getMemoryPoolMXBeans()) {
registry.register(new MemoryPoolMeter(registry, mbean));
Expand Down Expand Up @@ -103,33 +101,6 @@ private static void monitorCompilationMXBean(Registry registry) {
}
}

private static void maybeRegisterHotspotInternal(Registry registry) {
if (HotspotRuntime.isSupported()) {
// The safepointCount is reported as the count for both the safepointTime and
// safepointSyncTime. This should allow the metrics to work as normal timers and
// for the user to compute the average time spent per operation.
Object mbean = HotspotRuntime.getRuntimeMBean();

PolledMeter.using(registry)
.withName("jvm.hotspot.safepointTime")
.withTag(Statistic.count)
.monitorMonotonicCounter(mbean, b -> HotspotRuntime.getSafepointCount());
PolledMeter.using(registry)
.withName("jvm.hotspot.safepointTime")
.withTag(Statistic.totalTime)
.monitorMonotonicCounterDouble(mbean, b -> HotspotRuntime.getSafepointTime() / 1000.0);

PolledMeter.using(registry)
.withName("jvm.hotspot.safepointSyncTime")
.withTag(Statistic.count)
.monitorMonotonicCounter(mbean, b -> HotspotRuntime.getSafepointCount());
PolledMeter.using(registry)
.withName("jvm.hotspot.safepointSyncTime")
.withTag(Statistic.totalTime)
.monitorMonotonicCounterDouble(mbean, b -> HotspotRuntime.getSafepointSyncTime() / 1000.0);
}
}

/**
* Add meters based on configured JMX queries. See the {@link JmxConfig} class for more
* details.
Expand Down

This file was deleted.

0 comments on commit d8bb9a8

Please sign in to comment.