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");
}
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");
}
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");
}
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");
}
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;
}
Aggregations