aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/xmpp/s2s/CleaningUp.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-02-03 12:35:59 +0300
committerGravatar Vitaly Takmazov2016-02-03 12:35:59 +0300
commit380018da475ff41d3375e7f2bea0a192a4d9b178 (patch)
tree6e6e38e109c73ff5bc233681143ee4ac2bff9a96 /src/main/java/com/juick/xmpp/s2s/CleaningUp.java
parent36f542dad713d173102a60a1aa7e336e6db31200 (diff)
single xmpp component, WIP
Diffstat (limited to 'src/main/java/com/juick/xmpp/s2s/CleaningUp.java')
-rw-r--r--src/main/java/com/juick/xmpp/s2s/CleaningUp.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/CleaningUp.java b/src/main/java/com/juick/xmpp/s2s/CleaningUp.java
index 48771580..12ac7449 100644
--- a/src/main/java/com/juick/xmpp/s2s/CleaningUp.java
+++ b/src/main/java/com/juick/xmpp/s2s/CleaningUp.java
@@ -15,14 +15,14 @@ public class CleaningUp implements Runnable {
public void run() {
while (true) {
try {
- PrintWriter statsFile = new PrintWriter(XMPPComponent.STATSFILE, "UTF-8");
+ PrintWriter statsFile = new PrintWriter(S2SComponent.STATSFILE, "UTF-8");
statsFile.write("<html><body><h2>Threads: " + Thread.activeCount() + "</h2>");
- statsFile.write("<h2>Out (" + XMPPComponent.outConnections.size() + ")</h2><table border=1><tr><th>to</th><th>sid</th><th>inactive</th><th>out packets</th><th>out bytes</th></tr>");
+ statsFile.write("<h2>Out (" + S2SComponent.outConnections.size() + ")</h2><table border=1><tr><th>to</th><th>sid</th><th>inactive</th><th>out packets</th><th>out bytes</th></tr>");
long now = System.currentTimeMillis();
- synchronized (XMPPComponent.outConnections) {
- for (Iterator<ConnectionOut> i = XMPPComponent.outConnections.iterator(); i.hasNext();) {
+ synchronized (S2SComponent.outConnections) {
+ for (Iterator<ConnectionOut> i = S2SComponent.outConnections.iterator(); i.hasNext();) {
ConnectionOut c = i.next();
int inactive = (int) ((double) (now - c.tsLocalData) / 1000.0);
if (inactive > 900) {
@@ -40,10 +40,10 @@ public class CleaningUp implements Runnable {
}
}
- statsFile.write("</table><h2>In (" + XMPPComponent.inConnections.size() + ")</h2><table border=1><tr><th>from</th><th>sid</th><th>inactive</th><th>in packets</th></tr>");
+ statsFile.write("</table><h2>In (" + S2SComponent.inConnections.size() + ")</h2><table border=1><tr><th>from</th><th>sid</th><th>inactive</th><th>in packets</th></tr>");
- synchronized (XMPPComponent.inConnections) {
- for (Iterator<ConnectionIn> i = XMPPComponent.inConnections.iterator(); i.hasNext();) {
+ synchronized (S2SComponent.inConnections) {
+ for (Iterator<ConnectionIn> i = S2SComponent.inConnections.iterator(); i.hasNext();) {
ConnectionIn c = i.next();
int inactive = (int) ((double) (now - c.tsRemoteData) / 1000.0);
if (inactive > 900) {
@@ -73,10 +73,10 @@ public class CleaningUp implements Runnable {
}
}
- statsFile.write("</table><h2>Cache (" + XMPPComponent.outCache.size() + ")</h2><table border=1><tr><th>host</th><th>live</th><th>size</th></tr>");
+ statsFile.write("</table><h2>Cache (" + S2SComponent.outCache.size() + ")</h2><table border=1><tr><th>host</th><th>live</th><th>size</th></tr>");
- synchronized (XMPPComponent.outCache) {
- for (Iterator<CacheEntry> i = XMPPComponent.outCache.iterator(); i.hasNext();) {
+ synchronized (S2SComponent.outCache) {
+ for (Iterator<CacheEntry> i = S2SComponent.outCache.iterator(); i.hasNext();) {
CacheEntry c = i.next();
int inactive = (int) ((double) (now - c.tsCreated) / 1000.0);
if (inactive > 600) {