Search in sources :

Example 36 with TabularData

use of javax.management.openmbean.TabularData in project druid by alibaba.

the class MergeStatFilterTest_tddl method setUp.

protected void setUp() throws Exception {
    TabularData sqlList = JdbcStatManager.getInstance().getSqlList();
    if (sqlList.size() > 0) {
        for (Object item : JdbcStatManager.getInstance().getSqlList().values()) {
            String text = JSONUtils.toJSONString(item);
            System.out.println(text);
        }
    }
    Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());
    dataSource = new DruidDataSource();
    dataSource.setUrl("jdbc:mock:xx");
    dataSource.setFilters("mergeStat");
    dataSource.setDbType("mysql");
}
Also used : DruidDataSource(com.alibaba.druid.pool.DruidDataSource) TabularData(javax.management.openmbean.TabularData)

Example 37 with TabularData

use of javax.management.openmbean.TabularData in project druid by alibaba.

the class MergeStatFilterTest_tddl_1 method setUp.

protected void setUp() throws Exception {
    TabularData sqlList = JdbcStatManager.getInstance().getSqlList();
    if (sqlList.size() > 0) {
        for (Object item : JdbcStatManager.getInstance().getSqlList().values()) {
            String text = JSONUtils.toJSONString(item);
            System.out.println(text);
        }
    }
    Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());
    dataSource = new DruidDataSource();
    dataSource.setUrl("jdbc:mock:xx");
    dataSource.setFilters("mergeStat");
    dataSource.setDbType("mysql");
}
Also used : DruidDataSource(com.alibaba.druid.pool.DruidDataSource) TabularData(javax.management.openmbean.TabularData)

Example 38 with TabularData

use of javax.management.openmbean.TabularData in project druid by alibaba.

the class MergeStatFilterTest_tddl_2 method setUp.

protected void setUp() throws Exception {
    TabularData sqlList = JdbcStatManager.getInstance().getSqlList();
    if (sqlList.size() > 0) {
        for (Object item : JdbcStatManager.getInstance().getSqlList().values()) {
            String text = JSONUtils.toJSONString(item);
            System.out.println(text);
        }
    }
    Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());
    dataSource = new DruidDataSource();
    dataSource.setUrl("jdbc:mock:xx");
    dataSource.setFilters("mergeStat");
    dataSource.setDbType("mysql");
}
Also used : DruidDataSource(com.alibaba.druid.pool.DruidDataSource) TabularData(javax.management.openmbean.TabularData)

Example 39 with TabularData

use of javax.management.openmbean.TabularData in project druid by alibaba.

the class MergeStatFilterTest_tddl_3 method setUp.

protected void setUp() throws Exception {
    TabularData sqlList = JdbcStatManager.getInstance().getSqlList();
    if (sqlList.size() > 0) {
        for (Object item : JdbcStatManager.getInstance().getSqlList().values()) {
            String text = JSONUtils.toJSONString(item);
            System.out.println(text);
        }
    }
    Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());
    dataSource = new DruidDataSource();
    dataSource.setUrl("jdbc:mock:xx");
    dataSource.setFilters("mergeStat");
    dataSource.setDbType("mysql");
    dataSource.setConnectionProperties("druid.useGloalDataSourceStat");
}
Also used : DruidDataSource(com.alibaba.druid.pool.DruidDataSource) TabularData(javax.management.openmbean.TabularData)

Example 40 with TabularData

use of javax.management.openmbean.TabularData in project hibernate-orm by hibernate.

the class HibernateStatsImpl method getQueryStats.

@Override
public TabularData getQueryStats() {
    final List<CompositeData> result = new ArrayList<CompositeData>();
    final Statistics statistics = getStatistics();
    for (String query : statistics.getQueries()) {
        final QueryStats queryStats = new QueryStats(query, statistics.getQueryStatistics(query));
        result.add(queryStats.toCompositeData());
    }
    final TabularData td = QueryStats.newTabularDataInstance();
    td.putAll(result.toArray(new CompositeData[result.size()]));
    return td;
}
Also used : CompositeData(javax.management.openmbean.CompositeData) ArrayList(java.util.ArrayList) Statistics(org.hibernate.stat.Statistics) TabularData(javax.management.openmbean.TabularData)

Aggregations

TabularData (javax.management.openmbean.TabularData)183 CompositeData (javax.management.openmbean.CompositeData)91 TabularDataSupport (javax.management.openmbean.TabularDataSupport)67 ObjectName (javax.management.ObjectName)54 MBeanServer (javax.management.MBeanServer)50 CompositeType (javax.management.openmbean.CompositeType)47 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)43 Test (org.junit.Test)38 Map (java.util.Map)28 ArrayList (java.util.ArrayList)23 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)21 HashMap (java.util.HashMap)20 TabularType (javax.management.openmbean.TabularType)17 Bundle (org.osgi.framework.Bundle)17 AbstractIntegrationTest (org.apache.aries.jmx.AbstractIntegrationTest)15 Collection (java.util.Collection)13 IOException (java.io.IOException)11 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)9 List (java.util.List)8 ServiceReference (org.osgi.framework.ServiceReference)8