Commit 3f860a63 authored by Axel Brand's avatar Axel Brand Committed by daeva

Gojara

- nearing release of 2.1 , already running for us but waiting to see if performs good under load
- give better advice what to set as admin_jid

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13710 b35dd754-fafc-0310-a699-88a17e54d16e
parent ec72fd1c
...@@ -193,6 +193,7 @@ public class GojaraAdminManager { ...@@ -193,6 +193,7 @@ public class GojaraAdminManager {
/** /**
* gathers Gatewaystatistics for specific gateway * gathers Gatewaystatistics for specific gateway
*
* @param gateway * @param gateway
*/ */
public void gatherGatewayStatistics(String gateway) { public void gatherGatewayStatistics(String gateway) {
...@@ -201,7 +202,7 @@ public class GojaraAdminManager { ...@@ -201,7 +202,7 @@ public class GojaraAdminManager {
messagesTo(gateway); messagesTo(gateway);
usedMemoryOf(gateway); usedMemoryOf(gateway);
averageMemoryOfUser(gateway); averageMemoryOfUser(gateway);
// Log.info("Gathering Gateway-Statistics for " + gateway); // Log.info("Gathering Gateway-Statistics for " + gateway);
} }
private void uptime(String transport) { private void uptime(String transport) {
...@@ -231,6 +232,7 @@ public class GojaraAdminManager { ...@@ -231,6 +232,7 @@ public class GojaraAdminManager {
/** /**
* Preps the specified stat for nicer output which is used in tables. * Preps the specified stat for nicer output which is used in tables.
*
* @param gateway * @param gateway
* @param stat * @param stat
* @return * @return
...@@ -244,7 +246,7 @@ public class GojaraAdminManager { ...@@ -244,7 +246,7 @@ public class GojaraAdminManager {
long diffMinutes = time / 60 % 60; long diffMinutes = time / 60 % 60;
long diffHours = time / (60 * 60) % 24; long diffHours = time / (60 * 60) % 24;
long diffDays = time / (24 * 60 * 60); long diffDays = time / (24 * 60 * 60);
return "" + diffSeconds+ " Sec " + diffMinutes + " Min " + diffHours + " Hours " + diffDays + " Days"; return "" + diffSeconds + " Sec " + diffMinutes + " Min " + diffHours + " Hours " + diffDays + " Days";
} }
} else if (stat.equals("messages_from_xmpp")) { } else if (stat.equals("messages_from_xmpp")) {
if (gatewayStatisticsMap.get(gateway).get("messages_from_xmpp") != null) if (gatewayStatisticsMap.get(gateway).get("messages_from_xmpp") != null)
......
...@@ -54,8 +54,8 @@ public class TransportSessionManager { ...@@ -54,8 +54,8 @@ public class TransportSessionManager {
* @param subdomain * @param subdomain
*/ */
public void removeTransport(String subdomain) { public void removeTransport(String subdomain) {
Map<String, Long> disconnectedUsers = transportSessions.remove(subdomain); transportSessions.remove(subdomain);
Log.debug("Removed " + subdomain + "from TransportSessionMap " + disconnectedUsers.toString()); Log.debug("Removed " + subdomain + "from TransportSessionMap ");
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<%@ page import="java.util.Set"%> <%@ page import="java.util.Set"%>
<%@ page import="java.util.Date"%> <%@ page import="java.util.Date"%>
<%@ page import="java.util.ArrayList"%> <%@ page import="java.util.ArrayList"%>
<%@ page import="org.jivesoftware.openfire.XMPPServer" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<% <%
...@@ -62,7 +63,7 @@ ...@@ -62,7 +63,7 @@
<div align="center"> <div align="center">
<% if (!gojaraAdminManager.areGatewaysConfigured()) {%> <% if (!gojaraAdminManager.areGatewaysConfigured()) {%>
<h2><a href="gojara-gatewayStatistics.jsp">Warning: Not all Gateways are configured for admin usage. This means unregistrations will not be properly executed.<br/> <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> Please configure admin_jid = gojaraadmin@<%= XMPPServer.getInstance().getServerInfo().getXMPPDomain() %> in Spectrum2 transport configuration.</a></h2>
<% } %> <% } %>
<h5>Logintime 1970 means User did register but never logged in, <h5>Logintime 1970 means User did register but never logged in,
propably because of invalid credentials.</h5> propably because of invalid credentials.</h5>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<%@ page import="java.util.Set"%> <%@ page import="java.util.Set"%>
<%@ page import="java.util.Date"%> <%@ page import="java.util.Date"%>
<%@ page import="java.util.ArrayList"%> <%@ page import="java.util.ArrayList"%>
<%@ page import="org.jivesoftware.openfire.XMPPServer" %>
<% <%
TransportSessionManager transportManager = TransportSessionManager.getInstance(); TransportSessionManager transportManager = TransportSessionManager.getInstance();
...@@ -39,7 +40,7 @@ ...@@ -39,7 +40,7 @@
<div align="center"> <div align="center">
<% if (!gojaraAdminManager.areGatewaysConfigured()) {%> <% if (!gojaraAdminManager.areGatewaysConfigured()) {%>
<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/> <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/> Please configure admin_jid = gojaraadmin@<%= XMPPServer.getInstance().getServerInfo().getXMPPDomain() %> in Spectrum2 transport configuration.</a></h2><br/>
<% } %> <% } %>
<h4> <h4>
Current number of active Gateway Sessions: &emsp; Current number of active Gateway Sessions: &emsp;
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
import="org.jivesoftware.openfire.plugin.gojara.sessions.GojaraAdminManager"%> import="org.jivesoftware.openfire.plugin.gojara.sessions.GojaraAdminManager"%>
<%@ page import="java.util.Map"%> <%@ page import="java.util.Map"%>
<%@ page import="java.util.Set"%> <%@ page import="java.util.Set"%>
<%@ page import="org.jivesoftware.openfire.XMPPServer" %>
<% <%
TransportSessionManager transportSessionManager = TransportSessionManager.getInstance(); TransportSessionManager transportSessionManager = TransportSessionManager.getInstance();
GojaraAdminManager gojaraAdminManager = GojaraAdminManager.getInstance(); GojaraAdminManager gojaraAdminManager = GojaraAdminManager.getInstance();
gojaraAdminManager.gatherGatewayStatistics(); gojaraAdminManager.gatherGatewayStatistics();
String domain = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
%> %>
<html> <html>
<head> <head>
...@@ -22,7 +24,7 @@ ...@@ -22,7 +24,7 @@
<h2 style="color: red" align="center"> <h2 style="color: red" align="center">
Warning: Not all Gateways are configured for admin usage. Affected Warning: Not all Gateways are configured for admin usage. Affected
gateways will not show spectrum2 data.<br /> Please configure admin_jid = gateways will not show spectrum2 data.<br /> Please configure admin_jid =
gojaraadmin@yourdomain in Spectrum2 transport configuration. gojaraadmin@<%=domain %> in Spectrum2 transport configuration.
</h2> </h2>
<hr /> <hr />
<% <%
...@@ -51,7 +53,11 @@ ...@@ -51,7 +53,11 @@
for (String gateway : gateways) { for (String gateway : gateways) {
%> %>
<tr class="jive-odd"> <tr class="jive-odd">
<td><%=gateway %></td> <td><%=gateway %> <% if (!gateway.contains(domain)) { %>
<img alt="gateway configuration info" src="/images/header-help_new.gif" title="Component name does not include server name: <%=domain%>.
It should be configured like this: transport.server-name, e.g.: icq.<%=gateway%>">
<% } %>
</td>
<td> <td>
<% if (gojaraAdminManager.isGatewayConfigured(gateway)) { %> <% if (gojaraAdminManager.isGatewayConfigured(gateway)) { %>
<img alt="Yes" src="/images/success-16x16.gif"> <img alt="Yes" src="/images/success-16x16.gif">
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import="org.jivesoftware.openfire.plugin.gojara.database.SessionEntry"%> import="org.jivesoftware.openfire.plugin.gojara.database.SessionEntry"%>
<%@ page <%@ page
import="org.jivesoftware.openfire.plugin.gojara.utils.JspHelper"%> import="org.jivesoftware.openfire.plugin.gojara.utils.JspHelper"%>
<%@ page import="org.jivesoftware.openfire.XMPPServer" %>
<%@ page import="java.util.Map"%> <%@ page import="java.util.Map"%>
<%@ page import="java.util.Set"%> <%@ page import="java.util.Set"%>
<%@ page import="java.util.Date"%> <%@ page import="java.util.Date"%>
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
<% if (!gojaraAdminManager.areGatewaysConfigured()) {%> <% if (!gojaraAdminManager.areGatewaysConfigured()) {%>
<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/> <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> Please configure admin_jid = gojaraadmin@<%= XMPPServer.getInstance().getServerInfo().getXMPPDomain() %> in Spectrum2 transport configuration.</a></h2>
<% } %> <% } %>
<% <%
......
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