public static void main(String[] args) { load(); } }
public final static synchronized CounterExecutingManager getInstance() { if (instance == null) { instance = new CounterExecutingManager(); instance.setDaemon(true); instance.setName(ThreadUtil.getName(instance)); instance.start(); } return instance; }
public void put(Invocation counter) { taskSec.add(new CountStat(counter)); } protected static class Invocation {
private void gatherAndSendCounter(long now) { CounterBasket basket = new CounterBasket(); for (int i = 0; i < countStatList.size(); i++) { CountStat stat = countStatList.get(i); try { if (stat.counter.interval() <= now - stat.xtime) { stat.xtime = now; stat.counter.process(basket); } } catch (Throwable t) { t.printStackTrace(); } } PerfCounterPack[] packs = basket.getList(); DataProxy.sendCounter(packs); }
public static void counter(CounterBasket cw) { if (plugIn != null) { try { plugIn.counter(cw.getPack(TimeTypeEnum.REALTIME)); } catch (Throwable th) { } } } }
public void run() { while (true) { ThreadUtil.sleep(1000); if (conf.counter_enabled == false) { continue; } long now = System.currentTimeMillis(); gatherAndSendCounter(now); gatherAndSendInteractionCounter(now); } }
public PerfCounterPack getPack(String objName, byte timeType) { Key key = new Key(objName, timeType); PerfCounterPack p = table.get(key); if (p == null) { p = new PerfCounterPack(); p.objName = objName; p.timetype = timeType; table.put(key, p); } return p; }
public void sendBatchService(long currentTime){ if(server == null){ return; } checkBatchService(currentTime); updateBatchService(); PerfCounterPack[] pks = cb.getList(); sendCounter(pks); }
public final static synchronized CounterExecutingManager getInstance() { if (instance == null) { instance = new CounterExecutingManager(); instance.setDaemon(true); instance.setName(ThreadUtil.getName(instance)); instance.start(); } return instance; }
private void gatherAndSendCounter(long now) { CounterBasket basket = new CounterBasket(); for (int i = 0; i < countStatList.size(); i++) { CountStat stat = countStatList.get(i); try { if (stat.counter.interval() <= now - stat.xtime) { stat.xtime = now; stat.counter.process(basket); } } catch (Throwable t) { t.printStackTrace(); } } PerfCounterPack[] packs = basket.getList(); DataProxy.sendCounter(packs); }
public static void counter(CounterBasket cw) { if (plugIn != null) { try { plugIn.counter(cw.getPack(TimeTypeEnum.REALTIME)); } catch (Throwable th) { } } } }
public void putInteractionCounter(Invocation counter) { interactionCountStatList.add(new CountStat(counter)); }
public PerfCounterPack getPack(String objName, byte timeType) { Key key = new Key(objName, timeType); PerfCounterPack p = table.get(key); if (p == null) { p = new PerfCounterPack(); p.objName = objName; p.timetype = timeType; table.put(key, p); } return p; }
public final static synchronized CounterExecutingManager getInstance() { if (instance == null) { instance = new CounterExecutingManager(); instance.setDaemon(true); instance.setName(ThreadUtil.getName(instance)); instance.start(); } return instance; }
public PerfCounterPack getPack(byte timeType) { return getPack(Configure.getInstance().getObjName(), timeType); }
public void putCounter(Invocation counter) { countStatList.add(new CountStat(counter)); }
public PerfCounterPack getPack(byte timeType) { return getPack(Configure.getInstance().getObjName(), timeType); }
public void putInteractionCounter(Invocation counter) { interactionCountStatList.add(new CountStat(counter)); }
public PerfCounterPack getPack(byte timeType) { return getPack(Configure.getInstance().getObjName(), timeType); }
public void putCounter(Invocation counter) { countStatList.add(new CountStat(counter)); }