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

Gojara

- do a stats check of transport directly after it has confirmed admin_config, stats check for all transports only from jsp call
- presentational changes in jsp files

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13708 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3edd8734
...@@ -96,6 +96,7 @@ public class GojaraAdminManager { ...@@ -96,6 +96,7 @@ public class GojaraAdminManager {
public void confirmGatewayConfig(String gateway) { public void confirmGatewayConfig(String gateway) {
unconfiguredGateways.remove(gateway); unconfiguredGateways.remove(gateway);
configuredGateways.add(gateway); configuredGateways.add(gateway);
gatherGatewayStatistics(gateway);
} }
/** /**
...@@ -175,6 +176,9 @@ public class GojaraAdminManager { ...@@ -175,6 +176,9 @@ public class GojaraAdminManager {
this.gatewayStatisticsMap = gatewayStatisticsMap; this.gatewayStatisticsMap = gatewayStatisticsMap;
} }
/**
* For JSP usage, dont refresh statistics more than once a minute
*/
public void gatherGatewayStatistics() { public void gatherGatewayStatistics() {
if (refreshCooldown == 0) { if (refreshCooldown == 0) {
refreshCooldown = System.currentTimeMillis(); refreshCooldown = System.currentTimeMillis();
...@@ -186,16 +190,24 @@ public class GojaraAdminManager { ...@@ -186,16 +190,24 @@ public class GojaraAdminManager {
refreshCooldown = System.currentTimeMillis(); refreshCooldown = System.currentTimeMillis();
Log.info("Gathering Gateway-Statistics!");
for (String gateway : configuredGateways) { for (String gateway : configuredGateways) {
gatherGatewayStatistics(gateway);
}
}
/**
* Used for single transport, called after we have configured it so we dont have to wait.
* @param gateway
*/
public void gatherGatewayStatistics(String gateway) {
uptime(gateway); uptime(gateway);
messagesFrom(gateway); messagesFrom(gateway);
messagesTo(gateway); messagesTo(gateway);
usedMemoryOf(gateway); usedMemoryOf(gateway);
averageMemoryOfUser(gateway); averageMemoryOfUser(gateway);
} // Log.info("Gathering Gateway-Statistics for " + gateway);
} }
private void uptime(String transport) { private void uptime(String transport) {
Message message = generateCommand(transport, "uptime"); Message message = generateCommand(transport, "uptime");
router.route(message); router.route(message);
......
...@@ -11,7 +11,6 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -11,7 +11,6 @@ import java.util.concurrent.ConcurrentHashMap;
import org.jivesoftware.openfire.plugin.gojara.database.*; import org.jivesoftware.openfire.plugin.gojara.database.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.xmpp.packet.JID;
/** /**
* This is the central point for doing anything Gojara GatewaySession related. We keep track of Users connected to * This is the central point for doing anything Gojara GatewaySession related. We keep track of Users connected to
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
<meta name="pageID" content="gojaraRegistrationAdministration" /> <meta name="pageID" content="gojaraRegistrationAdministration" />
</head> </head>
<body> <body>
<div align="center">
<ul style="list-style: none;padding:0;margin:0;">
<% <%
//do unregisters if supplied //do unregisters if supplied
if (request.getParameterMap() != null) { if (request.getParameterMap() != null) {
...@@ -47,14 +49,14 @@ ...@@ -47,14 +49,14 @@
String[] uservalues = request.getParameterValues(key.toString()); String[] uservalues = request.getParameterValues(key.toString());
for (String transport : uservalues) { for (String transport : uservalues) {
%> %>
<ul> <li><%=transportManager.removeRegistrationOfUser(transport, key.toString())%></li>
<%=transportManager.removeRegistrationOfUser(transport, key.toString())%>
</ul>
<% <%
} }
} }
} }
%> %>
</ul>
</div>
<div align="center"> <div align="center">
......
...@@ -45,14 +45,17 @@ ...@@ -45,14 +45,17 @@
%> %>
<br> <br>
<br> <br>
<div align="center">
<ul style="list-style: none;padding:0;margin:0;">
<% <%
for (String key : unregister) { for (String key : unregister) {
%> %>
<div align="center"><%=transportManager.removeRegistrationOfUser(key, username)%></div><br> <li><%=transportManager.removeRegistrationOfUser(key, username)%></li>
<% <%
} }
%> %>
</ul></div>
<br> <br>
<br> <br>
......
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