Skip to content

Commit 7f3f1b6

Browse files
committed
remove unused method.
Signed-off-by: [email protected] <[email protected]>
1 parent 1a6c2d3 commit 7f3f1b6

File tree

1 file changed

+0
-37
lines changed
  • prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm

1 file changed

+0
-37
lines changed

prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetrics.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -138,43 +138,6 @@ private void register(PrometheusRegistry registry) {
138138
}
139139
}
140140

141-
private Map<String, Integer> getThreadStateCountMap(ThreadMXBean threadBean) {
142-
long[] threadIds = threadBean.getAllThreadIds();
143-
144-
// Code to remove any thread id values <= 0
145-
int writePos = 0;
146-
for (int i = 0; i < threadIds.length; i++) {
147-
if (threadIds[i] > 0) {
148-
threadIds[writePos++] = threadIds[i];
149-
}
150-
}
151-
152-
final int numberOfInvalidThreadIds = threadIds.length - writePos;
153-
threadIds = Arrays.copyOf(threadIds, writePos);
154-
155-
// Get thread information without computing any stack traces
156-
ThreadInfo[] allThreads = threadBean.getThreadInfo(threadIds, 0);
157-
158-
// Initialize the map with all thread states
159-
Map<String, Integer> threadCounts = new HashMap<>();
160-
for (Thread.State state : Thread.State.values()) {
161-
threadCounts.put(state.name(), 0);
162-
}
163-
164-
// Collect the actual thread counts
165-
for (ThreadInfo curThread : allThreads) {
166-
if (curThread != null) {
167-
Thread.State threadState = curThread.getThreadState();
168-
threadCounts.put(threadState.name(), threadCounts.get(threadState.name()) + 1);
169-
}
170-
}
171-
172-
// Add the thread count for invalid thread ids
173-
threadCounts.put(UNKNOWN, numberOfInvalidThreadIds);
174-
175-
return threadCounts;
176-
}
177-
178141
private Map<String, Integer> getThreadStateCountMapFromThreadGroup() {
179142
int threadsNew = 0;
180143
int threadsRunnable = 0;

0 commit comments

Comments
 (0)