@Test public void testHierarchicalCounterReset1() { testCounterHierarchy(); dc.resetCounterHierarchy("switch", "01/pktin"); checkCounters(1, 2, 3, 0, 20, 0, 0); }
@Override public void resetCounterHierarchy(String moduleName, String counterHierarchy) { RetCtrInfo rci = getCounterId(moduleName, counterHierarchy); if (!rci.allLevelsFound) { String missing = rci.levels[rci.foundUptoLevel]; log.error("Cannot reset counter hierarchy - missing counter {}", missing); return; } allCounters[rci.ctrIds[rci.foundUptoLevel-1]].cvalue.set(0); ArrayList<Integer> resetIds = getHierarchyBelow(moduleName, rci); for (int index : resetIds) { allCounters[index].cvalue.set(0); } }
DebugCounter implements IFloodlightModule, IDebugCounterService { @Override public void resetCounterHierarchy(String moduleName, String counterHierarchy) { RetCtrInfo rci = getCounterId(moduleName, counterHierarchy); if (!rci.allLevelsFound) { String missing = rci.levels[rci.foundUptoLevel]; log.error("Cannot reset counter hierarchy - missing counter {}", missing); return; } allCounters[rci.ctrIds[rci.foundUptoLevel-1]].cvalue.set(0); ArrayList<Integer> resetIds = getHierarchyBelow(moduleName, rci); for (int index : resetIds) { allCounters[index].cvalue.set(0); } } }
DebugCounter implements IFloodlightModule, IDebugCounterService { @Override public void resetCounterHierarchy(String moduleName, String counterHierarchy) { RetCtrInfo rci = getCounterId(moduleName, counterHierarchy); if (!rci.allLevelsFound) { String missing = rci.levels[rci.foundUptoLevel]; log.error("Cannot reset counter hierarchy - missing counter {}", missing); return; } allCounters[rci.ctrIds[rci.foundUptoLevel-1]].cvalue.set(0); ArrayList<Integer> resetIds = getHierarchyBelow(moduleName, rci); for (int index : resetIds) { allCounters[index].cvalue.set(0); } }  }
DebugCounter implements IFloodlightModule, IDebugCounterService { @Override public void resetCounterHierarchy(String moduleName, String counterHierarchy) { RetCtrInfo rci = getCounterId(moduleName, counterHierarchy); if (!rci.allLevelsFound) { String missing = rci.levels[rci.foundUptoLevel]; log.error("Cannot reset counter hierarchy - missing counter {}", missing); return; } allCounters[rci.ctrIds[rci.foundUptoLevel-1]].cvalue.set(0); ArrayList<Integer> resetIds = getHierarchyBelow(moduleName, rci); for (int index : resetIds) { allCounters[index].cvalue.set(0); } }  @Override IDebugCounter registerCounter(String moduleName, String counterHierarchy,
                           String counterDescription, CounterType counterType,
                           String... metaData); @Override void flushCounters(); @Override void resetCounterHierarchy(String moduleName, String counterHierarchy); @Override void resetAllCounters(); @Override void resetAllModuleCounters(String moduleName); @Override void enableCtrOnDemand(String moduleName, String counterHierarchy); @Override void disableCtrOnDemand(String moduleName, String counterHierarchy); @Override List<DebugCounterInfo> getCounterHierarchy(String moduleName,
                                                     String counterHierarchy); @Override List<DebugCounterInfo> getAllCounterValues(); @Override List<DebugCounterInfo> getModuleCounterValues(String moduleName); @Override boolean containsModuleCounterHierarchy(String moduleName,
                                                 String counterHierarchy); @Override boolean containsModuleName(String moduleName); @Override List<String> getModuleList(); @Override List<String> getModuleCounterList(String moduleName); @Override Collection<Class<? extends IFloodlightService>> getModuleServices(); @Override Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls(); @Override Collection<Class<? extends IFloodlightService>> getModuleDependencies(); @Override void init(FloodlightModuleContext context); @Override void startUp(FloodlightModuleContext context); }
DebugCounter implements IFloodlightModule, IDebugCounterService { @Override public void resetCounterHierarchy(String moduleName, String counterHierarchy) { RetCtrInfo rci = getCounterId(moduleName, counterHierarchy); if (!rci.allLevelsFound) { String missing = rci.levels[rci.foundUptoLevel]; log.error("Cannot reset counter hierarchy - missing counter {}", missing); return; } allCounters[rci.ctrIds[rci.foundUptoLevel-1]].cvalue.set(0); ArrayList<Integer> resetIds = getHierarchyBelow(moduleName, rci); for (int index : resetIds) { allCounters[index].cvalue.set(0); } }  @Override IDebugCounter registerCounter(String moduleName, String counterHierarchy,
                           String counterDescription, CounterType counterType,
                           String... metaData); @Override void flushCounters(); @Override void resetCounterHierarchy(String moduleName, String counterHierarchy); @Override void resetAllCounters(); @Override void resetAllModuleCounters(String moduleName); @Override void enableCtrOnDemand(String moduleName, String counterHierarchy); @Override void disableCtrOnDemand(String moduleName, String counterHierarchy); @Override List<DebugCounterInfo> getCounterHierarchy(String moduleName,
                                                     String counterHierarchy); @Override List<DebugCounterInfo> getAllCounterValues(); @Override List<DebugCounterInfo> getModuleCounterValues(String moduleName); @Override boolean containsModuleCounterHierarchy(String moduleName,
                                                 String counterHierarchy); @Override boolean containsModuleName(String moduleName); @Override List<String> getModuleList(); @Override List<String> getModuleCounterList(String moduleName); @Override Collection<Class<? extends IFloodlightService>> getModuleServices(); @Override Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls(); @Override Collection<Class<? extends IFloodlightService>> getModuleDependencies(); @Override void init(FloodlightModuleContext context); @Override void startUp(FloodlightModuleContext context);  }