Package org.jmxtrans.embedded

Examples of org.jmxtrans.embedded.Query


    }

    @Test
    public void validateBasicQuery() throws MalformedObjectNameException {
        ObjectName objectName = new ObjectName("java.lang:type=MemoryPool,name=PS Eden Space");
        Query query = queriesByResultName.get(objectName.toString());
        assertThat(query.getObjectName(), is(objectName));
        assertThat(query.getResultAlias(), nullValue());
        assertThat(query.getQueryAttributes().size(), is(1));
        QueryAttribute queryAttribute = query.getQueryAttributes().iterator().next();
        assertThat(queryAttribute.getName(), is("CollectionUsageThreshold"));
    }
View Full Code Here


    }

    @Test
    public void validateAliasedQuery() throws MalformedObjectNameException {
        ObjectName objectName = new ObjectName("java.lang:type=MemoryPool,name=PS Eden Space");
        Query query = queriesByResultName.get("test-aliased-query");
        assertThat(query.getObjectName(), is(objectName));
        assertThat(query.getResultAlias(), is("test-aliased-query"));
        assertThat(query.getQueryAttributes().size(), is(1));
        QueryAttribute queryAttribute = query.getQueryAttributes().iterator().next();
        assertThat(queryAttribute.getName(), is("CollectionUsageThresholdCount"));
    }
View Full Code Here

    EmbeddedJmxTrans embeddedJmxTrans;

    @Test
    public void test() {
        Map<String, Query> queries = TestUtils.indexQueriesByAliasOrName(embeddedJmxTrans.getQueries());
        Query tomcatProcessorQuery = queries.get("tomcat.global-request-processor.%name%");
        assertNotNull(tomcatProcessorQuery);
    }
View Full Code Here

        assertThat(queryAttribute.getName(), is("CollectionUsageThresholdCount"));
    }

    @Test
    public void validateDisabledOutputWriters() throws MalformedObjectNameException {
        Query query = queriesByResultName.get("test-aliased-query");
        assertThat(query.getOutputWriters().size(), is(0));
        assertThat(query.getEffectiveOutputWriters().size(), is(4));

    }
View Full Code Here

    EmbeddedJmxTrans embeddedJmxTrans;

    @Test
    public void test() {
        Map<String,Query> queries = TestUtils.indexQueriesByAliasOrName(embeddedJmxTrans.getQueries());
        Query tomcatProcessorQuery = queries.get("tomcat.global-request-processor.%name%");
        assertNotNull(tomcatProcessorQuery);
    }
View Full Code Here

    }

    @Test
    public void validateQueryWithAttributeAlias() throws MalformedObjectNameException {
        ObjectName objectName = new ObjectName("java.lang:type=MemoryPool,name=PS Eden Space");
        Query query = queriesByResultName.get("test-attribute-with-alias");
        assertThat(query.getObjectName(), is(objectName));
        assertThat(query.getResultAlias(), is("test-attribute-with-alias"));
        assertThat(query.getQueryAttributes().size(), is(1));
        QueryAttribute queryAttribute = query.getQueryAttributes().iterator().next();
        assertThat(queryAttribute.getName(), is("CollectionUsageThresholdCount"));
        assertThat(queryAttribute.getResultAlias(), is("test-alias"));
    }
View Full Code Here

    }

    @Test
    public void validateQueryWithAttributes() throws MalformedObjectNameException {
        ObjectName objectName = new ObjectName("java.lang:type=MemoryPool,name=PS Eden Space");
        Query query = queriesByResultName.get("test-attributes");
        assertThat(query.getObjectName(), is(objectName));
        assertThat(query.getResultAlias(), is("test-attributes"));

        assertThat(query.getQueryAttributes().size(), is(2));

        Map<String, QueryAttribute> queryAttributes = TestUtils.indexQueryAttributesByAliasOrName(query.getQueryAttributes());

        {
            QueryAttribute queryAttribute = queryAttributes.get("CollectionUsageThresholdExceeded");
            assertThat(queryAttribute.getName(), is("CollectionUsageThresholdExceeded"));
            assertThat(queryAttribute.getResultAlias(), nullValue());
View Full Code Here

    EmbeddedJmxTrans embeddedJmxTrans;

    @Test
    public void test() {
        Map<String, Query> queries = TestUtils.indexQueriesByAliasOrName(embeddedJmxTrans.getQueries());
        Query tomcatProcessorQuery = queries.get("tomcat.global-request-processor.%name%");
        assertNotNull(tomcatProcessorQuery);
    }
View Full Code Here

    }

    @Test
    public void validateQueryWithAliasedAttributes() throws MalformedObjectNameException {
        ObjectName objectName = new ObjectName("java.lang:type=MemoryPool,name=PS Eden Space");
        Query query = queriesByResultName.get("test-attributes-with-alias");
        assertThat(query.getObjectName(), is(objectName));
        assertThat(query.getResultAlias(), is("test-attributes-with-alias"));

        assertThat(query.getQueryAttributes().size(), is(3));

        Map<String, QueryAttribute> queryAttributes = TestUtils.indexQueryAttributesByAliasOrName(query.getQueryAttributes());


        {
            QueryAttribute queryAttribute = queryAttributes.get("collection-usage-threshold-supported");
            assertThat(queryAttribute.getName(), is("CollectionUsageThresholdSupported"));
View Full Code Here

    }

    @Test
    public void validateQueryWithGaugeAndCounterAttributes() throws MalformedObjectNameException {
        ObjectName objectName = new ObjectName("java.lang:type=OperatingSystem");
        Query query = queriesByResultName.get("test-gauge-and-counter-attributes");
        assertThat(query.getObjectName(), is(objectName));
        assertThat(query.getResultAlias(), is("test-gauge-and-counter-attributes"));

        assertThat(query.getQueryAttributes().size(), is(2));

        Map<String, QueryAttribute> queryAttributes = TestUtils.indexQueryAttributesByAliasOrName(query.getQueryAttributes());


        {
            QueryAttribute queryAttribute = queryAttributes.get("SystemLoadAverage");
            assertThat(queryAttribute.getName(), is("SystemLoadAverage"));
View Full Code Here

TOP

Related Classes of org.jmxtrans.embedded.Query

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.