*
*/
public EventTracker() {
- _events = new HashMap<Thread, List<Event>>();
+ clear();
}
+ public void clear() {
+ _events = new HashMap<Thread, List<Event>>();
+ }
+
/**
* Called by a thread to inform that an event has occurred.
*
}
return count;
}
+
+ /**
+ * Gets the total event count over all threads.
+ * @return
+ */
+ public synchronized int getEventCount() {
+ int count = 0;
+ for (Thread thread: _events.keySet()) {
+ count += _events.get(thread).size();
+ }
+ return count;
+ }
}