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); }
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 void sendBatchService(long currentTime){ if(server == null){ return; } checkBatchService(currentTime); updateBatchService(); PerfCounterPack[] pks = cb.getList(); sendCounter(pks); }
public void run() { while (true) { ThreadUtil.sleep(1000); if (conf.counter_enabled == false) { continue; } long now = System.currentTimeMillis(); CounterBasket pw = new CounterBasket(); for (int i = 0; i < taskSec.size(); i++) { CountStat r = taskSec.get(i); try { if (r.counter.interval() <= now - r.xtime) { r.xtime = now; r.counter.process(pw); } } catch (Throwable t) { t.printStackTrace(); } } // PerfCounterPack[] pks = pw.getList(); DataProxy.sendCounter(pks); } } private CounterExecutingManager() {
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); }