Commit 017b8d10 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Removing user stat, Javadoc.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6421 b35dd754-fafc-0310-a699-88a17e54d16e
parent d01e98c8
...@@ -17,6 +17,7 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -17,6 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
* Stores statistics being tracked by the server. * Stores statistics being tracked by the server.
*/ */
public class StatisticsManager { public class StatisticsManager {
private static StatisticsManager instance = new StatisticsManager(); private static StatisticsManager instance = new StatisticsManager();
public static StatisticsManager getInstance() { public static StatisticsManager getInstance() {
...@@ -24,17 +25,18 @@ public class StatisticsManager { ...@@ -24,17 +25,18 @@ public class StatisticsManager {
} }
private final Map<String, Statistic> statistics = new ConcurrentHashMap<String, Statistic>(); private final Map<String, Statistic> statistics = new ConcurrentHashMap<String, Statistic>();
private final Map<String, List<String>> multiStatGroups = new ConcurrentHashMap<String, List<String>>(); private final Map<String, List<String>> multiStatGroups = new ConcurrentHashMap<String, List<String>>();
private final Map<String, String> keyToGroupMap = new ConcurrentHashMap<String, String>(); private final Map<String, String> keyToGroupMap = new ConcurrentHashMap<String, String>();
private StatisticsManager() {} private StatisticsManager() {
}
/** /**
* Adds a stat to be tracked to the StatManager. * Adds a stat to be tracked to the StatManager.
* *
* @param definition The statistic to be tracked. * @param statKey the statistic key.
* @param definition the statistic to be tracked.
*/ */
public void addStatistic(String statKey, Statistic definition) { public void addStatistic(String statKey, Statistic definition) {
statistics.put(statKey, definition); statistics.put(statKey, definition);
...@@ -86,4 +88,4 @@ public class StatisticsManager { ...@@ -86,4 +88,4 @@ public class StatisticsManager {
statistics.remove(statKey); statistics.remove(statKey);
} }
} }
\ No newline at end of file
...@@ -17,15 +17,11 @@ import org.jivesoftware.stringprep.StringprepException; ...@@ -17,15 +17,11 @@ import org.jivesoftware.stringprep.StringprepException;
import org.jivesoftware.util.*; import org.jivesoftware.util.*;
import org.jivesoftware.wildfire.IQResultListener; import org.jivesoftware.wildfire.IQResultListener;
import org.jivesoftware.wildfire.XMPPServer; import org.jivesoftware.wildfire.XMPPServer;
import org.jivesoftware.wildfire.stats.StatisticsManager;
import org.jivesoftware.wildfire.stats.i18nStatistic;
import org.jivesoftware.wildfire.stats.Statistic;
import org.jivesoftware.wildfire.event.UserEventDispatcher; import org.jivesoftware.wildfire.event.UserEventDispatcher;
import org.xmpp.packet.IQ; import org.xmpp.packet.IQ;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* Manages users, including loading, creating and deleting. * Manages users, including loading, creating and deleting.
...@@ -46,8 +42,6 @@ public class UserManager implements IQResultListener { ...@@ -46,8 +42,6 @@ public class UserManager implements IQResultListener {
private static UserProvider provider; private static UserProvider provider;
private static UserManager instance = new UserManager(); private static UserManager instance = new UserManager();
private static final String USERS_CREATED_STAT = "users_created";
static { static {
// Initialize caches. // Initialize caches.
userCache = CacheManager.initializeCache("User", "userCache", 512 * 1024, userCache = CacheManager.initializeCache("User", "userCache", 512 * 1024,
...@@ -102,18 +96,7 @@ public class UserManager implements IQResultListener { ...@@ -102,18 +96,7 @@ public class UserManager implements IQResultListener {
return instance; return instance;
} }
private AtomicInteger usersCreated = new AtomicInteger(0);
private UserManager() { private UserManager() {
// Add a statistic to record users being created.
StatisticsManager.getInstance().addStatistic(USERS_CREATED_STAT, new i18nStatistic(USERS_CREATED_STAT,
Statistic.Type.rate_total)
{
public double sample() {
return usersCreated.getAndSet(0);
}
});
} }
/** /**
...@@ -150,9 +133,6 @@ public class UserManager implements IQResultListener { ...@@ -150,9 +133,6 @@ public class UserManager implements IQResultListener {
UserEventDispatcher.dispatchEvent(user, UserEventDispatcher.EventType.user_created, UserEventDispatcher.dispatchEvent(user, UserEventDispatcher.EventType.user_created,
Collections.emptyMap()); Collections.emptyMap());
// Increment users created statistic.
usersCreated.getAndIncrement();
return user; return user;
} }
......
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