Commit ff5546ab authored by Axel Brand's avatar Axel Brand Committed by daeva

Gojara

- show if transport is configured on Spectrum2 Stats page
- remove debug logging from info tab so it wont spam
- tweak presentation of stats shown in jsp through slighty bigger numbers

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13706 b35dd754-fafc-0310-a699-88a17e54d16e
parent 71627198
......@@ -313,9 +313,10 @@ public class DatabaseManager {
pstmt.setString(2, transport);
pstmt.setLong(3, time);
pstmt.executeUpdate();
Log.info("I have inserted " + user + " with " + transport + " at " + time);
} else
Log.info("I have updated " + user + " with " + transport + " at " + time);
Log.debug("I have inserted " + user + " with " + transport + " at " + time);
} else {
Log.debug("I have updated " + user + " with " + transport + " at " + time);
}
} catch (SQLException sqle) {
Log.error(sqle);
} finally {
......
......@@ -65,7 +65,7 @@ public class MainInterceptor implements PacketInterceptor {
}
public boolean addTransport(String subDomain) {
Log.info("Trying to add " + subDomain + " to Set of watched Transports.");
Log.info("Adding " + subDomain + " to watched Transports.");
boolean retval = this.activeTransports.add(subDomain);
if (retval) {
tSessionManager.addTransport(subDomain);
......@@ -76,7 +76,7 @@ public class MainInterceptor implements PacketInterceptor {
}
public boolean removeTransport(String subDomain) {
Log.info("Trying to remove " + subDomain + " from Set of watched Transports.");
Log.info("Removing " + subDomain + " from watched Transports.");
tSessionManager.removeTransport(subDomain);
gojaraAdminmanager.gatewayUnregistered(subDomain);
return this.activeTransports.remove(subDomain);
......
......@@ -26,7 +26,7 @@ public class GojaraAdminProcessor extends AbstractRemoteRosterProcessor {
Message message = (Message) packet;
// handle different commands
Log.info("Intercepted something: " + message.toString());
Log.debug("Intercepted spectrum message: " + message.toString());
String command = packet.getID();
if (command.equals("online_users")) {
handleOnlineUsers(message, subdomain);
......@@ -48,7 +48,7 @@ public class GojaraAdminProcessor extends AbstractRemoteRosterProcessor {
}
private void handleOnlineUsers(Message message, String subdomain) {
Log.info("Found online_users command!");
Log.debug("Found online_users command!");
if (message.getBody().equals("0"))
return;
String[] content = message.getBody().split("\\r?\\n");
......@@ -59,7 +59,7 @@ public class GojaraAdminProcessor extends AbstractRemoteRosterProcessor {
}
private void handleUnregister(Message message) {
Log.info("Found unregister command! ");
Log.debug("Found unregister command! ");
}
private void handleConfigCheck(String subdomain) {
......
......@@ -85,7 +85,7 @@ public class GojaraAdminManager {
message.setBody("status");
message.setType(Type.chat);
router.route(message);
Log.info("Sent config_check Packet!");
Log.info("Checking for admin configuration on " + gateway);
}
/**
......@@ -111,7 +111,7 @@ public class GojaraAdminManager {
public boolean areGatewaysConfigured() {
return unconfiguredGateways.isEmpty();
}
public boolean isGatewayConfigured(String gateway) {
return configuredGateways.contains(gateway);
}
......@@ -147,7 +147,7 @@ public class GojaraAdminManager {
Message message = generateCommand(transport, "online_users");
router.route(message);
Log.info("Sent online_users Packet!" + message.toString());
Log.debug("Sent online_users Packet!" + message.toString());
}
/**
......@@ -163,7 +163,7 @@ public class GojaraAdminManager {
Message message = generateCommand(transport, "unregister");
message.setBody("unregister " + _server.createJID(user, null).toString());
router.route(message);
Log.info("Sent Unregister Packet!" + message.toString());
Log.debug("Sent Unregister Packet!" + message.toString());
}
......
......@@ -46,7 +46,7 @@ public class TransportSessionManager {
*/
public void addTransport(String subdomain) {
transportSessions.put(subdomain, new ConcurrentHashMap<String, Long>(64, 0.75f, 1));
Log.info("Added key to transportSessionMap: " + subdomain);
Log.debug("Added key to transportSessionMap: " + subdomain);
}
/**
......@@ -56,7 +56,7 @@ public class TransportSessionManager {
*/
public void removeTransport(String subdomain) {
Map<String, Long> disconnectedUsers = transportSessions.remove(subdomain);
Log.info("Removed " + subdomain + "from TransportSessionMap " + disconnectedUsers.toString());
Log.debug("Removed " + subdomain + "from TransportSessionMap " + disconnectedUsers.toString());
}
......@@ -94,7 +94,7 @@ public class TransportSessionManager {
}
public boolean disconnectUserFrom(String transport, String user) {
Log.info("Trying to remove User " + JID.nodeprep(user) + " from Session for Transport " + transport);
// Log.debug("Trying to remove User " + JID.nodeprep(user) + " from Session for Transport " + transport);
if (isUserConnectedTo(transport, user)) {
transportSessions.get(transport).remove(user);
return true;
......@@ -137,7 +137,7 @@ public class TransportSessionManager {
* transportSessions
*/
public void initializeSessions() {
Log.info("initializing Sessions.");
Log.info("Initializing Sessions.");
for (String transport : transportSessions.keySet()) {
adminManager.getOnlineUsersOf(transport);
}
......
......@@ -57,14 +57,17 @@
%>
<center>
<div align="center">
<% if (!gojaraAdminManager.areGatewaysConfigured()) {%>
<h2 style="color:red">Warning: Not all Gateways are configured for admin usage. This means unregistrations will not be properly executed.<br/>
Please configure admin_jid = gojaraadmin@yourdomain in Spectrum2 transport configuration.</h2>
<h2><a href="gojara-gatewayStatistics.jsp">Warning: Not all Gateways are configured for admin usage. This means unregistrations will not be properly executed.<br/>
Please configure admin_jid = gojaraadmin@yourdomain in Spectrum2 transport configuration.</a></h2>
<% } %>
<h5>Logintime 1970 means User did register but never logged in,
propably because of invalid credentials.</h5>
</center>
<br>
<br>
Registrations total: <b style="font-size:150%"><%=transportManager.getNumberOfRegistrations()%></b><br>
</div>
<br>
<%
//Here we do our nice query
......@@ -89,7 +92,6 @@
next_items = numOfSessions;
%>
<p>
Registrations total: <b><%=transportManager.getNumberOfRegistrations()%></b><br>
<br> Pages: [
<%
for (int i = 1; i <= numOfPages; i++) {
......@@ -167,9 +169,9 @@
]
</p>
<br>
<center>
<div align="center">
<input type="submit" value="Unregister">
</center>
</div>
</form>
</body>
</html>
\ No newline at end of file
......@@ -36,14 +36,14 @@
<meta name="pageID" content="gojaraSessions" />
</head>
<body>
<div align="center">
<% if (!gojaraAdminManager.areGatewaysConfigured()) {%>
<center><h2 style="color:red">Warning: Not all Gateways are configured for admin usage. This means session details may be inaccurate or not logged at all.<br/>
Please configure admin_jid = gojaraadmin@yourdomain in Spectrum2 transport configuration.</h2></center><br/>
<h2><a href="gojara-gatewayStatistics.jsp">Warning: Not all Gateways are configured for admin usage. This means session details may be inaccurate or not logged at all.<br/>
Please configure admin_jid = gojaraadmin@yourdomain in Spectrum2 transport configuration.</a></h2><br/>
<% } %>
<h4>
Current number of active Gateway Sessions: &emsp;
<%=transportManager.getNumberOfActiveSessions()%>
<b style="font-size:150%"><%= transportManager.getNumberOfActiveSessions() %></b>
</h4>
<br>
<%
......@@ -51,10 +51,10 @@
for (String transport : sessions.keySet()) {
%>
<%=transport.substring(0, 10)%>... :
<b><%=sessions.get(transport).size()%></b> &emsp;
<b style="font-size:150%"><%=sessions.get(transport).size()%></b> &emsp;
<%
}
%>
%></div>
<br>
<br>
<%
......
......@@ -19,13 +19,11 @@
<%
if (!gojaraAdminManager.areGatewaysConfigured()) {
%>
<center>
<h2 style="color: red">
<h2 style="color: red" align="center">
Warning: Not all Gateways are configured for admin usage. Affected
gateways will not show any data.<br /> Please configure admin_jid =
gateways will not show spectrum2 data.<br /> Please configure admin_jid =
gojaraadmin@yourdomain in Spectrum2 transport configuration.
</h2>
</center>
<hr />
<%
}
......@@ -37,13 +35,14 @@
<thead>
<tr>
<th nowrap>Name</th>
<th nowrap>Admin Configured?</th>
<th nowrap># Online Users</th>
<th nowrap># Registrations</th>
<th nowrap>Uptime</th>
<th nowrap># Messages received</th>
<th nowrap># Messages sent</th>
<th nowrap>Used Memory</th>
<th nowrap>Avg. Memory per User</th>
<th nowrap>Avg. Mem. per User</th>
</tr>
</thead>
<tbody>
......@@ -53,8 +52,15 @@
%>
<tr class="jive-odd">
<td><%=gateway %></td>
<td><%=transportSessionManager.getNumberOfActiveSessionsFor(gateway)%></td>
<td><%=transportSessionManager.getNumberOfRegistrationsForTransport(gateway)%></td>
<td>
<% if (gojaraAdminManager.isGatewayConfigured(gateway)) { %>
<img alt="Yes" src="/images/success-16x16.gif">
<% } else { %>
<img alt="No" src="/images/error-16x16.gif" title="Will probably not show correct # of online users and not do unregister properly.">
<% }%>
</td>
<td><div style="font-size:140%"><%=transportSessionManager.getNumberOfActiveSessionsFor(gateway)%></div></td>
<td><div style="font-size:140%"><%=transportSessionManager.getNumberOfRegistrationsForTransport(gateway)%></div></td>
<td><%=gojaraAdminManager.getStatisticsPresentationString(gateway, "uptime")%></td>
<td><%=gojaraAdminManager.getStatisticsPresentationString(gateway, "messages_from_xmpp")%></td>
<td><%=gojaraAdminManager.getStatisticsPresentationString(gateway, "messages_to_xmpp") %></td>
......
......@@ -33,9 +33,10 @@
</script>
</head>
<body>
<% if (!gojaraAdminManager.areGatewaysConfigured()) {%>
<center><h2 style="color:red">Warning: Not all Gateways are configured for admin usage. This means unregistrations will not be properly executed.<br/>
Please configure admin_jid = gojaraadmin@yourdomain in Spectrum2 transport configuration.</h2></center>
<h2 align="center"><a href="gojara-gatewayStatistics.jsp">Warning: Not all Gateways are configured for admin usage. This means unregistrations will not be properly executed.<br/>
Please configure admin_jid = gojaraadmin@yourdomain in Spectrum2 transport configuration.</a></h2>
<% } %>
<%
......@@ -48,7 +49,7 @@
for (String key : unregister) {
%>
<%=transportManager.removeRegistrationOfUser(key, username)%><br>
<div align="center"><%=transportManager.removeRegistrationOfUser(key, username)%></div><br>
<%
}
%>
......@@ -60,15 +61,11 @@
ArrayList<GatewaySession> userconnections = transportManager.getConnectionsFor(username);
if (userconnections.isEmpty()) {
%>
<h2>
<center>User has no active sessions</center>
</h2>
<h2 align="center">User has no active sessions</h2>
<%
} else {
%>
<center>
<h1>Active Sessions:</h1>
</center>
<h1 align="center">Active Sessions:</h1>
<br>
<div class="jive-table">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
......@@ -99,9 +96,7 @@
<br>
<hr>
<center>
<h1>Associated Registrations:</h1>
</center>
<h1 align="center">Associated Registrations:</h1>
<br>
<form name="unregister-form" id="gojara-sessDetailsUnregister"
method="POST">
......@@ -156,15 +151,11 @@
</tbody>
</table>
</div>
<div align="center"><br>
<input type="button" value="check/uncheck all" onclick='checkedAll();'>
<br>
<center>
<input type="button" value="check/uncheck all"
onclick='checkedAll();'>
</center>
<br>
<center>
<input type="submit" value="Unregister">
</center>
</div>
</form>
</body>
</html>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment