Package com.jitlogic.zorka.common.test.support

Examples of com.jitlogic.zorka.common.test.support.TestJmx


        return tmpDir;
    }


    public TestJmx makeTestJmx(String name, long nom, long div) throws Exception {
        TestJmx bean = new TestJmx();
        bean.setNom(nom);
        bean.setDiv(div);

        testMbs.registerMBean(bean, new ObjectName(name));

        return bean;
    }
View Full Code Here


        }
    }


    private TestJmx makeTestJmx(String name, long nom, long div, String... md) throws Exception {
        TestJmx bean = new TestJmx();

        bean.setNom(nom);
        bean.setDiv(div);

        for (int i = 1; i < md.length; i += 2) {
            bean.put(md[i - 1], md[i]);
        }

        testMbs.registerMBean(bean, new ObjectName(name));

        return bean;
View Full Code Here

        assertEquals("10", zorkaAgent.query("zorka.jmx(\"test\", \"test:name=bean1,type=TestJmx\", \"Nom\")"));
    }

    @Test
    public void testOneObjectAvgRateCount() throws Exception {
        TestJmx tj = makeTestJmx("test:name=bean1,type=TestJmx", 0, 0);
        List<Object> path = counter.list("test", "test:name=bean1,type=TestJmx");

        assertEquals(0.0, counter.get(path, "Nom", "Div", AvgRateCounter.AVG1), 0.01);
        tj.setNom(5);
        tj.setDiv(5);

        assertEquals(1.0, counter.get(path, "Nom", "Div", AvgRateCounter.AVG1), 0.01);
        tj.setNom(10);
        tj.setDiv(20);
        assertEquals(0.5, counter.get(path, "Nom", "Div", AvgRateCounter.AVG1), 0.01);
    }
View Full Code Here

        assertEquals(0.5, counter.get(path, "Nom", "Div", AvgRateCounter.AVG1), 0.01);
    }

    @Test
    public void testOneObjectTwoAverages() throws Exception {
        TestJmx tj = makeTestJmx("test:name=bean1,type=TestJmx", 0, 0);
        List<Object> path = counter.list("test", "test:name=bean1,type=TestJmx");

        tj.setNom(5);
        tj.setDiv(5);
        assertEquals(0.0, counter.get(path, "Nom", "Div", AvgRateCounter.AVG1), 0.01);

        tj.setNom(10);
        tj.setDiv(20);
        assertEquals(0.0, counter.get(path, "Nom", "Div", AvgRateCounter.AVG5), 0.01);

        tj.setNom(10);
        tj.setDiv(20);
        assertEquals(0.33, counter.get(path, "Nom", "Div", AvgRateCounter.AVG1), 0.01);

        tj.setNom(10);
        tj.setDiv(20);
        assertEquals(0.0, counter.get(path, "Nom", "Div", AvgRateCounter.AVG5), 0.01);
    }
View Full Code Here

        assertEquals(0.0, counter.get(path, "Nom", "Div", AvgRateCounter.AVG5), 0.01);
    }

    @Test
    public void testZorkaLibRateFn1() throws Exception {
        TestJmx tj = makeTestJmx("test:name=bean1,type=TestJmx", 0, 0);

        assertEquals(0.0, zorka.rate("test", "test:name=bean1,type=TestJmx", "Nom", "Div", 60), 0.01);
        tj.setNom(5);
        tj.setDiv(5);
        assertEquals(1.0, zorka.rate("test", "test:name=bean1,type=TestJmx", "Nom", "Div", 60), 0.01);
        assertEquals(1.0, zorka.rate("test", "test:name=bean1,type=TestJmx", "Nom", "Div", "AVG1"), 0.01);
    }
View Full Code Here

        Assert.assertEquals(1, results.size());
    }


    private TestJmx makeTestJmx(String name, long nom, long div, String... md) throws Exception {
        TestJmx bean = new TestJmx();

        bean.setNom(nom);
        bean.setDiv(div);

        for (int i = 1; i < md.length; i += 2) {
            bean.put(md[i - 1], md[i]);
        }

        testMbs.registerMBean(bean, new ObjectName(name));

        return bean;
View Full Code Here

TOP

Related Classes of com.jitlogic.zorka.common.test.support.TestJmx

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.