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 {
public void confirmGatewayConfig(String gateway) {
unconfiguredGateways.remove(gateway);
configuredGateways.add(gateway);
gatherGatewayStatistics(gateway);
}
/**
......@@ -175,6 +176,9 @@ public class GojaraAdminManager {
this.gatewayStatisticsMap = gatewayStatisticsMap;
}
/**
* For JSP usage, dont refresh statistics more than once a minute
*/
public void gatherGatewayStatistics() {
if (refreshCooldown == 0) {
refreshCooldown = System.currentTimeMillis();
......@@ -186,16 +190,24 @@ public class GojaraAdminManager {
refreshCooldown = System.currentTimeMillis();
Log.info("Gathering Gateway-Statistics!");
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);
messagesFrom(gateway);
messagesTo(gateway);
usedMemoryOf(gateway);
averageMemoryOfUser(gateway);
}
// Log.info("Gathering Gateway-Statistics for " + gateway);
}
private void uptime(String transport) {
Message message = generateCommand(transport, "uptime");
router.route(message);
......
......@@ -11,7 +11,6 @@ import java.util.concurrent.ConcurrentHashMap;
import org.jivesoftware.openfire.plugin.gojara.database.*;
import org.slf4j.Logger;
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
......
......@@ -36,6 +36,8 @@
<meta name="pageID" content="gojaraRegistrationAdministration" />
</head>
<body>
<div align="center">
<ul style="list-style: none;padding:0;margin:0;">
<%
//do unregisters if supplied
if (request.getParameterMap() != null) {
......@@ -47,14 +49,14 @@
String[] uservalues = request.getParameterValues(key.toString());
for (String transport : uservalues) {
%>
<ul>
<%=transportManager.removeRegistrationOfUser(transport, key.toString())%>
</ul>
<li><%=transportManager.removeRegistrationOfUser(transport, key.toString())%></li>
<%
}
}
}
%>
</ul>
</div>
<div align="center">
......
......@@ -45,14 +45,17 @@
%>
<br>
<br>
<div align="center">
<ul style="list-style: none;padding:0;margin:0;">
<%
for (String key : unregister) {
%>
<div align="center"><%=transportManager.removeRegistrationOfUser(key, username)%></div><br>
<li><%=transportManager.removeRegistrationOfUser(key, username)%></li>
<%
}
%>
</ul></div>
<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