Skip to content
Snippets Groups Projects
Commit 76ff3f6b authored by srosse's avatar srosse
Browse files

no-jira: threads counter for mrtg updated to work with newer release of tomcat

parent e46f1ffb
No related branches found
No related tags found
No related merge requests found
......@@ -169,8 +169,8 @@ public class MRTGStatsDispatcher implements Dispatcher {
int httpsCount = 0;
int activeSessionCnt = 0;
if (command.equals("users")) { // get user stats of (authenticated) usersessions
Set userSessions = UserSession.getAuthenticatedUserSessions();
for (Iterator it_usess = userSessions.iterator(); it_usess.hasNext();) {
Set<UserSession> userSessions = UserSession.getAuthenticatedUserSessions();
for (Iterator<UserSession> it_usess = userSessions.iterator(); it_usess.hasNext();) {
UserSession usess = (UserSession) it_usess.next();
activeSessionCnt++;
SessionInfo sessInfo = usess.getSessionInfo();
......@@ -182,10 +182,10 @@ public class MRTGStatsDispatcher implements Dispatcher {
result.append("\n0\n");
result.append(instanceId);
} else if (command.equals("webdav")) { // get webdav stats of (authenticated) usersessions
Set userSessions = UserSession.getAuthenticatedUserSessions();
Set<UserSession> userSessions = UserSession.getAuthenticatedUserSessions();
int webdavcount = 0;
int securewebdavcount = 0;
for (Iterator it_usess = userSessions.iterator(); it_usess.hasNext();) {
for (Iterator<UserSession> it_usess = userSessions.iterator(); it_usess.hasNext();) {
UserSession usess = (UserSession) it_usess.next();
SessionInfo sessInfo = usess.getSessionInfo();
if (sessInfo.isWebDAV()) {
......@@ -234,15 +234,15 @@ public class MRTGStatsDispatcher implements Dispatcher {
// Number of active threads
ThreadGroup group = Thread.currentThread().getThreadGroup();
Thread[] threads = new Thread[ group.activeCount() ];
group.enumerate( threads, false );
int counter = 0;
for ( Thread t : threads ) {
if (t == null) continue;
// http-8080-Processor and TP-Processor
// not precise, but good enouth
if ( t.getName().indexOf("-Processor") != -1) {
counter++;
}
group.enumerate( threads, false );
int counter = 0;
for ( Thread t : threads ) {
if (t == null) continue;
// http-8080-Processor and TP-Processor not precise, but good enough
if (t.getName().startsWith("http-") || t.getName().startsWith("ajp-")
|| t.getName().indexOf("-Processor") > 0) {
counter++;
}
}
result.append(counter).append("\n");
result.append("0\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment