private void gatherAndSendInteractionCounter(long now) { InteractionCounterBasket basket = new InteractionCounterBasket(); for (int i = 0; i < interactionCountStatList.size(); i++) { CountStat stat = interactionCountStatList.get(i); try { if (stat.counter.interval() <= now - stat.xtime) { stat.xtime = now; stat.counter.process(basket); } } catch (Throwable t) { t.printStackTrace(); } } InteractionPerfCounterPack[] packs = basket.geAllAsArray(); if (packs != null && packs.length > 0) { DataProxy.sendCounter(packs); } }
public void add(String interactionType, InteractionPerfCounterPack pack) { List<InteractionPerfCounterPack> packList = getList(interactionType); if (packList == null) { packList = new ArrayList<InteractionPerfCounterPack>(); packListMap.put(interactionType, packList); } packList.add(pack); }
private void addInteractionsToBasket(InteractionCounterBasket basket, String interactionType, LinkedMap<MeterInteractionManager.Key, MeterInteraction> apiIncomingMeterMap, int periodSec) { Enumeration<LinkedMap.LinkedEntry<MeterInteractionManager.Key, MeterInteraction>> entries = apiIncomingMeterMap.entries(); while (entries.hasMoreElements()) { LinkedMap.LinkedEntry<MeterInteractionManager.Key, MeterInteraction> entry = entries.nextElement(); MeterInteractionManager.Key key = entry.getKey(); MeterInteraction meterInteraction = entry.getValue(); InteractionPerfCounterPack pack = new InteractionPerfCounterPack(conf.getObjName(), interactionType); pack.fromHash = key.fromHash; pack.toHash = key.toHash; pack.period = periodSec; pack.count = meterInteraction.getCount(periodSec); pack.errorCount = meterInteraction.getErrorCount(periodSec); pack.totalElapsed = meterInteraction.getSumTime(periodSec); basket.add(interactionType, pack); } } }
private void addInteractionsToBasket(InteractionCounterBasket basket, String interactionType, LinkedMap<MeterInteractionManager.Key, MeterInteraction> apiIncomingMeterMap, int periodSec) { Enumeration<LinkedMap.LinkedEntry<MeterInteractionManager.Key, MeterInteraction>> entries = apiIncomingMeterMap.entries(); while (entries.hasMoreElements()) { LinkedMap.LinkedEntry<MeterInteractionManager.Key, MeterInteraction> entry = entries.nextElement(); MeterInteractionManager.Key key = entry.getKey(); MeterInteraction meterInteraction = entry.getValue(); InteractionPerfCounterPack pack = new InteractionPerfCounterPack(conf.getObjName(), interactionType); pack.fromHash = key.fromHash; pack.toHash = key.toHash; pack.period = periodSec; pack.count = meterInteraction.getCount(periodSec); pack.errorCount = meterInteraction.getErrorCount(periodSec); pack.totalElapsed = meterInteraction.getSumTime(periodSec); basket.add(interactionType, pack); } } }
private void gatherAndSendInteractionCounter(long now) { InteractionCounterBasket basket = new InteractionCounterBasket(); for (int i = 0; i < interactionCountStatList.size(); i++) { CountStat stat = interactionCountStatList.get(i); try { if (stat.counter.interval() <= now - stat.xtime) { stat.xtime = now; stat.counter.process(basket); } } catch (Throwable t) { t.printStackTrace(); } } InteractionPerfCounterPack[] packs = basket.geAllAsArray(); if (packs != null && packs.length > 0) { DataProxy.sendCounter(packs); } }
public void add(String interactionType, InteractionPerfCounterPack pack) { List<InteractionPerfCounterPack> packList = getList(interactionType); if (packList == null) { packList = new ArrayList<InteractionPerfCounterPack>(); packListMap.put(interactionType, packList); } packList.add(pack); }
private void addInteractionsToBasket(InteractionCounterBasket basket, String interactionType, LinkedMap<MeterInteractionManager.Key, MeterInteraction> apiIncomingMeterMap, int periodSec) { Enumeration<LinkedMap.LinkedEntry<MeterInteractionManager.Key, MeterInteraction>> entries = apiIncomingMeterMap.entries(); while (entries.hasMoreElements()) { LinkedMap.LinkedEntry<MeterInteractionManager.Key, MeterInteraction> entry = entries.nextElement(); MeterInteractionManager.Key key = entry.getKey(); MeterInteraction meterInteraction = entry.getValue(); InteractionPerfCounterPack pack = new InteractionPerfCounterPack(conf.getObjName(), interactionType); pack.fromHash = key.fromHash; pack.toHash = key.toHash; pack.period = periodSec; pack.count = meterInteraction.getCount(periodSec); pack.errorCount = meterInteraction.getErrorCount(periodSec); pack.totalElapsed = meterInteraction.getSumTime(periodSec); basket.add(interactionType, pack); } } }
private void gatherAndSendInteractionCounter(long now) { InteractionCounterBasket basket = new InteractionCounterBasket(); for (int i = 0; i < interactionCountStatList.size(); i++) { CountStat stat = interactionCountStatList.get(i); try { if (stat.counter.interval() <= now - stat.xtime) { stat.xtime = now; stat.counter.process(basket); } } catch (Throwable t) { t.printStackTrace(); } } InteractionPerfCounterPack[] packs = basket.geAllAsArray(); if (packs != null && packs.length > 0) { DataProxy.sendCounter(packs); } }
public void add(String interactionType, InteractionPerfCounterPack pack) { List<InteractionPerfCounterPack> packList = getList(interactionType); if (packList == null) { packList = new ArrayList<InteractionPerfCounterPack>(); packListMap.put(interactionType, packList); } packList.add(pack); }