Not sure what you are expecting this tool to do but I would create some data structures to record these times and counts like
class UserActionStats { int count; long durationMS; long start = 0; public void startAction() { start = System.currentTimeMillis(); } public void endAction() { durationMS += System.currentTimeMillis() - start; count++; } }
A collection for these could look like
private static final Map<String, UserActionStats> map = new HashMap<String, UserActionStats>(); public static UserActionStats forUser(String userName) { synchronized(map) { UserActionStats uas = map.get(userName); if (uas == null) map.put(userName, uas = new UserActionStats()); return uas; } }