Skip to content

Commit e742337

Browse files
committed
Set setCurrentThreadCountEvent directly
1 parent 01d1d59 commit e742337

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/monitor/ThreadPoolMonitor.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ public void onMaxNumberOfThreadsEvent(AbstractThreadPool threadPool, int maxNumb
8686
grizzlyMonitoring.getThreadPoolProbeProvider().maxNumberOfThreadsReachedEvent(
8787
monitoringId, threadPool.getConfig().getPoolName(),
8888
maxNumberOfThreads);
89+
grizzlyMonitoring.getThreadPoolProbeProvider().setCurrentThreadCountEvent(
90+
monitoringId, threadPool.getConfig().getPoolName(),
91+
threadPool.getSize());
8992
}
9093

9194
@Override
@@ -95,6 +98,9 @@ public void onTaskDequeueEvent(AbstractThreadPool threadPool, Runnable task) {
9598
Thread.currentThread().getId());
9699
grizzlyMonitoring.getConnectionQueueProbeProvider().onTaskDequeuedEvent(
97100
monitoringId, task.getClass().getName());
101+
grizzlyMonitoring.getThreadPoolProbeProvider().setCurrentThreadCountEvent(
102+
monitoringId, threadPool.getConfig().getPoolName(),
103+
threadPool.getSize());
98104
}
99105

100106
@Override
@@ -104,24 +110,36 @@ public void onTaskCancelEvent(AbstractThreadPool threadPool, Runnable task) {
104110
grizzlyMonitoring.getThreadPoolProbeProvider().threadReturnedToPoolEvent(
105111
monitoringId, threadPool.getConfig().getPoolName(),
106112
Thread.currentThread().getId());
113+
grizzlyMonitoring.getThreadPoolProbeProvider().setCurrentThreadCountEvent(
114+
monitoringId, threadPool.getConfig().getPoolName(),
115+
threadPool.getSize());
107116
}
108117

109118
@Override
110119
public void onTaskCompleteEvent(AbstractThreadPool threadPool, Runnable task) {
111120
grizzlyMonitoring.getThreadPoolProbeProvider().threadReturnedToPoolEvent(
112121
monitoringId, threadPool.getConfig().getPoolName(),
113122
Thread.currentThread().getId());
123+
grizzlyMonitoring.getThreadPoolProbeProvider().setCurrentThreadCountEvent(
124+
monitoringId, threadPool.getConfig().getPoolName(),
125+
threadPool.getSize());
114126
}
115127

116128
@Override
117129
public void onTaskQueueEvent(AbstractThreadPool threadPool, Runnable task) {
118130
grizzlyMonitoring.getConnectionQueueProbeProvider().onTaskQueuedEvent(
119131
monitoringId, task.getClass().getName());
132+
grizzlyMonitoring.getThreadPoolProbeProvider().setCurrentThreadCountEvent(
133+
monitoringId, threadPool.getConfig().getPoolName(),
134+
threadPool.getSize());
120135
}
121136

122137
@Override
123138
public void onTaskQueueOverflowEvent(AbstractThreadPool threadPool) {
124139
grizzlyMonitoring.getConnectionQueueProbeProvider().onTaskQueueOverflowEvent(
125140
monitoringId);
141+
grizzlyMonitoring.getThreadPoolProbeProvider().setCurrentThreadCountEvent(
142+
monitoringId, threadPool.getConfig().getPoolName(),
143+
threadPool.getSize());
126144
}
127145
}

0 commit comments

Comments
 (0)