Package net.floodlightcontroller.debugcounter.DebugCounter

Examples of net.floodlightcontroller.debugcounter.DebugCounter.RetCtrInfo


        isEqual(retval, exp);
    }

    @Test
    public void testHierarchy3() {
        RetCtrInfo rci = dc.getCounterId("switch", "01/pktin/drops");
        ArrayList<Integer> retval = dc.getHierarchyBelow("switch", rci);
        List<Integer> temp  = Arrays.asList(4, 42, 47, 427, 428, 2, 5, 8);
        exp.removeAll(temp);
        log.info("got==> {}, exp=> {}", retval, exp);
        isEqual(retval, exp);
View Full Code Here


        dc = new DebugCounter();
        mctr = dc.moduleCounters;
        mctr.put("linkd", new ConcurrentHashMap<String, CounterIndexStore>());
        mctr.get("linkd").put("linkevent", dc.new CounterIndexStore(24, null));
        mctr.put("switch", new ConcurrentHashMap<String, CounterIndexStore>());
        exp = dc.new RetCtrInfo();
    }
View Full Code Here

    }

    @Test
    public void testHierarchicalPut() {
        String counterName = "100hp";
        RetCtrInfo rci = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.hierarchical = false;
        exp.levels = counterName.split("/");
        printRCI("got ==>", rci);
        printRCI("exp ==>", exp);
View Full Code Here

        dc = new DebugCounter();
        mctr = dc.moduleCounters;
        mctr.put("linkd", new ConcurrentHashMap<String, CounterIndexStore>());
        mctr.get("linkd").put("linkevent", dc.new CounterIndexStore(24, null));
        mctr.put("switch", new ConcurrentHashMap<String, CounterIndexStore>());
        exp = dc.new RetCtrInfo();
    }
View Full Code Here

        exp = dc.new RetCtrInfo();
    }

    @Test
    public void testBasicCounterGet() {
        RetCtrInfo rci = dc.getCounterId("linkd", "linkevent");
        //exp.levels = new String[IDebugCounterService.MAX_HIERARCHY];
        exp.levels = "linkevent".split("/");
        exp.allLevelsFound = true;
        exp.foundUptoLevel = 1;
        exp.ctrIds[0] = 24;
View Full Code Here

        x.put("00:00:00:00:00:00:00:01",
              dc.new CounterIndexStore(10, null));

        // 1-level counter exists
        String counterName = "00:00:00:00:00:00:00:01";
        RetCtrInfo rci1 = dc.getCounterId("switch",counterName);
        exp.levels = counterName.split("/");
        exp.allLevelsFound = true;
        exp.foundUptoLevel = 1;
        exp.ctrIds[0] = 10;
        exp.levels[0] = counterName;
        assertEquals(exp, rci1);

        // 1-level counter does not exist
        counterName = "00:00:00:00:00:00:00:02";
        RetCtrInfo rci2 = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.foundUptoLevel = 0;
        exp.hierarchical = false;
        exp.levels = counterName.split("/");
        exp.ctrIds[0] = -1;
        printRCI("got==> ", rci2);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci2);

        // 2-level hierarchical counter does not exist
        counterName = "00:00:00:00:00:00:00:01/pktin";
        RetCtrInfo rci3 = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.hierarchical = true;
        exp.foundUptoLevel = 1;
        exp.ctrIds[0] = 10;
        exp.levels = counterName.split("/");
        printRCI("got==> ", rci3);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci3);

        // 3-level hierarchical counter does not exist
        counterName = "00:00:00:00:00:00:00:01/pktin/drops";
        RetCtrInfo rci4 = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.hierarchical = true;
        exp.foundUptoLevel = 1;
        exp.ctrIds[0] = 10;
        exp.levels = counterName.split("/");
        printRCI("got==> ", rci4);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci4);

        // 4-level hierarchical counter does not exist
        counterName = "00:00:00:00:00:00:00:01/pktin/drops/extra";
        RetCtrInfo rci5 = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.hierarchical = true;
        exp.foundUptoLevel = 1;
        exp.ctrIds[0] = 10;
        exp.levels = counterName.split("/");
View Full Code Here

        x.get("00:00:00:00:00:00:00:03").nextLevel.put("pktin",
                                                       dc.new CounterIndexStore(333, null));

        // 1-level counter exists
        String counterName = "00:00:00:00:00:00:00:01";
        RetCtrInfo rci1 = dc.getCounterId("switch",counterName);
        exp.levels = counterName.split("/");
        exp.allLevelsFound = true;
        exp.foundUptoLevel = 1;
        exp.ctrIds[0] = 10;
        exp.levels[0] = counterName;
        assertEquals(exp, rci1);

        // 1-level counter does not exist
        counterName = "00:00:00:00:00:00:00:02";
        RetCtrInfo rci2 = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.hierarchical = false;
        exp.levels = counterName.split("/");
        exp.foundUptoLevel = 0;
        exp.ctrIds[0] = -1;
        printRCI("got==> ", rci2);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci2);

        // 2-level hierarchical counter does not exist
        counterName = "00:00:00:00:00:00:00:01/pktin";
        RetCtrInfo rci3 = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.hierarchical = true;
        exp.ctrIds[0] = 10;
        exp.foundUptoLevel = 1;
        exp.levels = counterName.split("/");
        printRCI("got==> ", rci3);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci3);

        // 2-level hierarchical counter DOES exist
        counterName = "00:00:00:00:00:00:00:03/pktin";
        RetCtrInfo rci3x = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = true;
        exp.hierarchical = true;
        exp.foundUptoLevel = 2;
        exp.ctrIds[0] = 30;
        exp.ctrIds[1] = 333;
        exp.levels = counterName.split("/");
        printRCI("got==> ", rci3x);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci3x);

        // 2-level hierarchical counter does NOT exist
        counterName = "00:00:00:00:00:00:00:03/pktout";
        RetCtrInfo rci3y = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.hierarchical = true;
        exp.foundUptoLevel = 1;
        exp.ctrIds[0] = 30;
        exp.ctrIds[1] = -1;
        exp.levels = counterName.split("/");
        printRCI("got==> ", rci3y);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci3y);

        // 3-level hierarchical counter does not exist
        counterName = "00:00:00:00:00:00:00:03/pktin/drops";
        RetCtrInfo rci4 = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = false;
        exp.hierarchical = true;
        exp.foundUptoLevel = 2;
        exp.ctrIds[0] = 30;
        exp.ctrIds[1] = 333;
View Full Code Here

        x.get("00:00:00:00:00:00:00:05").nextLevel.get("pktin").nextLevel.
            put("drops", dc.new CounterIndexStore(1056, null));

        // 1-level counter exists
        String counterName = "00:00:00:00:00:00:00:01";
        RetCtrInfo rci1 = dc.getCounterId("switch",counterName);
        exp.levels = counterName.split("/");
        exp.allLevelsFound = true;
        exp.foundUptoLevel = 1;
        exp.ctrIds[0] = 10;
        exp.levels[0] = counterName;
        assertEquals(exp, rci1);

        // 2-level hierarchical counter DOES exist
        counterName = "00:00:00:00:00:00:00:03/pktin";
        RetCtrInfo rci3x = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = true;
        exp.hierarchical = true;
        exp.foundUptoLevel = 2;
        exp.ctrIds[0] = 30;
        exp.ctrIds[1] = 333;
        exp.levels = counterName.split("/");
        printRCI("got==> ", rci3x);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci3x);

        // 3-level hierarchical counter DOES exist
        counterName = "00:00:00:00:00:00:00:05/pktin/drops";
        RetCtrInfo rci4 = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = true;
        exp.hierarchical = true;
        exp.foundUptoLevel = 3;
        exp.ctrIds[0] = 50;
        exp.ctrIds[1] = 555;
        exp.ctrIds[2] = 1056;
        exp.levels = counterName.split("/");
        printRCI("got==> ", rci4);
        printRCI("exp==> ", exp);
        assertEquals(exp, rci4);

        // querying only 2 levels of a 3 level counter
        counterName = "00:00:00:00:00:00:00:05/pktin";
        RetCtrInfo rci4x = dc.getCounterId("switch", counterName);
        exp.allLevelsFound = true;
        exp.hierarchical = true;
        exp.foundUptoLevel = 2;
        exp.ctrIds[0] = 50;
        exp.ctrIds[1] = 555;
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.debugcounter.DebugCounter.RetCtrInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.