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 { ...@@ -169,8 +169,8 @@ public class MRTGStatsDispatcher implements Dispatcher {
int httpsCount = 0; int httpsCount = 0;
int activeSessionCnt = 0; int activeSessionCnt = 0;
if (command.equals("users")) { // get user stats of (authenticated) usersessions if (command.equals("users")) { // get user stats of (authenticated) usersessions
Set userSessions = UserSession.getAuthenticatedUserSessions(); Set<UserSession> userSessions = UserSession.getAuthenticatedUserSessions();
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(); UserSession usess = (UserSession) it_usess.next();
activeSessionCnt++; activeSessionCnt++;
SessionInfo sessInfo = usess.getSessionInfo(); SessionInfo sessInfo = usess.getSessionInfo();
...@@ -182,10 +182,10 @@ public class MRTGStatsDispatcher implements Dispatcher { ...@@ -182,10 +182,10 @@ public class MRTGStatsDispatcher implements Dispatcher {
result.append("\n0\n"); result.append("\n0\n");
result.append(instanceId); result.append(instanceId);
} else if (command.equals("webdav")) { // get webdav stats of (authenticated) usersessions } else if (command.equals("webdav")) { // get webdav stats of (authenticated) usersessions
Set userSessions = UserSession.getAuthenticatedUserSessions(); Set<UserSession> userSessions = UserSession.getAuthenticatedUserSessions();
int webdavcount = 0; int webdavcount = 0;
int securewebdavcount = 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(); UserSession usess = (UserSession) it_usess.next();
SessionInfo sessInfo = usess.getSessionInfo(); SessionInfo sessInfo = usess.getSessionInfo();
if (sessInfo.isWebDAV()) { if (sessInfo.isWebDAV()) {
...@@ -234,15 +234,15 @@ public class MRTGStatsDispatcher implements Dispatcher { ...@@ -234,15 +234,15 @@ public class MRTGStatsDispatcher implements Dispatcher {
// Number of active threads // Number of active threads
ThreadGroup group = Thread.currentThread().getThreadGroup(); ThreadGroup group = Thread.currentThread().getThreadGroup();
Thread[] threads = new Thread[ group.activeCount() ]; Thread[] threads = new Thread[ group.activeCount() ];
group.enumerate( threads, false ); group.enumerate( threads, false );
int counter = 0; int counter = 0;
for ( Thread t : threads ) { for ( Thread t : threads ) {
if (t == null) continue; if (t == null) continue;
// http-8080-Processor and TP-Processor // http-8080-Processor and TP-Processor not precise, but good enough
// not precise, but good enouth if (t.getName().startsWith("http-") || t.getName().startsWith("ajp-")
if ( t.getName().indexOf("-Processor") != -1) { || t.getName().indexOf("-Processor") > 0) {
counter++; counter++;
} }
} }
result.append(counter).append("\n"); result.append(counter).append("\n");
result.append("0\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