@Override // @ApiMethod(name = "stat.send", httpMethod = "post") public void sendStat(StatInfo statInfo) { ObjectifyService.begin(); logger.info(statInfo.getDetail()); statManager.updateSessionStat(statInfo); }
public static Map<String, Object> getTrackingMap(String search) { Map<String, Object> events = new TreeMap<String, Object>(); for (StatInfo info : StatInfo.list().values()) { Map<String, Object> infoMap = new LinkedHashMap<String, Object>(); String key = info.getName().replace("T$", "Times.").replace("I$", "Items.").replace("B$", "Data."); if (search.equals("*") || key.indexOf(search) >= 0) { infoMap.put("hps", info.getHps()); infoMap.put("hits", info.getHits()); infoMap.put("fails", info.getFails()); infoMap.put("sum", info.getSum()); infoMap.put("min", info.getMin()); infoMap.put("max", info.getMax()); infoMap.put("avg", info.getAvg()); events.put(key, infoMap); } } return events; }
public static void reset() { StatInfo.clear(); }