Package com.jitlogic.zorka.core.perfmon

Examples of com.jitlogic.zorka.core.perfmon.QueryDef


        testMbs.registerMBean(mbean, new ObjectName("test:type=ZorkaStats"));

        stats.getMethodCallStatistic("A").logCall(4L);
        stats.getMethodCallStatistic("B").logCall(1L);

        QueryDef query1 = zorka.query("test", "test:type=ZorkaStats", "type").get("stats").listAs("**", "PAR");
        Map<String, List<Map<String, String>>> obj1 = zabbixLib._discovery(query1);
        assertEquals("query with exact attrs should return data", 2, obj1.get("data").size());


        QueryDef query2 = zorka.query("test", "test:type=ZorkaStats").get("stats").listAs("**", "PAR");
        Map<String, List<Map<String, String>>> obj2 = zabbixLib._discovery(query2);
        assertEquals("query with redundant attrs should return no data", 0, obj2.get("data").size());
    }
View Full Code Here



    @Test
    public void testSimpleNullScan() throws Exception {
        TraceOutputJmxScanner scanner = perfmon.scanner("TEST",
                new QueryDef("test", "test:type=XXX,*", "name").get("Nom")
                        .metric(perfmon.metric("test", "test")));
        ObjectInspector.setField(scanner, "output", out);
        scanner.runCycle(100);
        Assert.assertEquals(0, results.size());
    }
View Full Code Here


    @Test
    public void testSimpleScanWithOneResult() throws Exception {
        TraceOutputJmxScanner scanner = perfmon.scanner("TEST",
                new QueryDef("test", "test:type=TestJmx,*", "name").get("Nom")
                        .metric(perfmon.metric("test", "test")));
        ObjectInspector.setField(scanner, "output", out);
        scanner.runCycle(100);
        Assert.assertEquals(1, results.size());
    }
View Full Code Here


    @Test
    public void testCheckIfMetricObjectsAreRegisteredAndHaveIds() throws Exception {
        TraceOutputJmxScanner scanner = perfmon.scanner("TEST",
                new QueryDef("test", "test:type=TestJmx,*", "name").get("Nom")
                        .metric(perfmon.metric("test", "test")));
        ObjectInspector.setField(scanner, "output", out);
        scanner.runCycle(100);
        List<PerfSample> samples = ((PerfRecord) results.get(0)).getSamples();

View Full Code Here

    // TODO check for dynamic attributes being passed and attached correctly

    @Test
    public void testCheckIfDynamicAttributesArePassedCorrectly() throws Exception {
        TraceOutputJmxScanner scanner = perfmon.scanner("TEST",
                new QueryDef("test", "test:type=TestJmx,*", "name").getAs("Nom", "ATTR")
                        .metric(
                                perfmon.metric("test", "test").dynamicAttrs("ATTR")));
        ObjectInspector.setField(scanner, "output", out);

        scanner.runCycle(100);
View Full Code Here


    @Test
    public void testCheckIfOutputDataIsProperlyCast() throws Exception {
        TraceOutputJmxScanner scanner = perfmon.scanner("TEST",
                new QueryDef("test", "test:type=TestJmx,*", "name").getAs("Nom", "ATTR")
                        .metric(
                                perfmon.metric("test", "test").dynamicAttrs("ATTR")));
        ObjectInspector.setField(scanner, "output", out);

        scanner.runCycle(100);
View Full Code Here


    @Test
    public void testTrivialSearchAttrOnly() {
        QueryLister lister = new QueryLister(mBeanServerRegistry,
                new QueryDef("test", "test:type=TestJmx,*", "name"));

        List<QueryResult> results = lister.list();

        Assert.assertEquals(2, results.size());

View Full Code Here


    @Test
    public void testTrivialSearchAndGetSingleAttr() {
        QueryLister lister = new QueryLister(mBeanServerRegistry,
                new QueryDef("test", "test:type=TestJmx,*", "name").getAs("Nom", "Nom"));

        List<QueryResult> results = lister.list();

        Assert.assertEquals(2, results.size());

View Full Code Here


    @Test
    public void testSearchAndGetMultipleAttrs() {
        QueryLister lister = new QueryLister(mBeanServerRegistry,
                new QueryDef("test", "test:type=TestJmx,*", "name").listAs("*", "Attr"));

        List<QueryResult> results = lister.list();

        Assert.assertEquals(6, results.size());

View Full Code Here


    @Test
    public void testSearchAndGetMultiSecondLevelAttr() {
        QueryLister lister = new QueryLister(mBeanServerRegistry,
                new QueryDef("test", "test:type=TestJmx,*", "name").get("StrMap").listAs("*", "Attr"));

        List<QueryResult> results = lister.list();

        Assert.assertEquals(6, results.size());

View Full Code Here

TOP

Related Classes of com.jitlogic.zorka.core.perfmon.QueryDef

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.