Examples of DruidDataSourceStatValue


Examples of com.alibaba.druid.pool.DruidDataSourceStatValue

            }

            DruidDataSource dataSource = (DruidDataSource) item;

            if (collectSqlEnable) {
                DruidDataSourceStatValue statValue = dataSource.getStatValueAndReset();
                statValueList.add(statValue);
            }

            if (collectSqlWallEnable) {
                WallProviderStatValue wallStatValue = dataSource.getWallStatValue(true);
View Full Code Here

Examples of com.alibaba.druid.pool.DruidDataSourceStatValue

            stmt.execute();
            stmt.close();
            conn.close();
        }
        {
            DruidDataSourceStatValue statValue = dataSource.getStatValueAndReset();
            Assert.assertEquals(1000, statValue.getSqlList().size());
            Assert.assertEquals(1000, statValue.getSqlSkipCount());
        }
       
        dataSource.setConnectionProperties("druid.stat.sql.MaxSize=2000");
        for (int i = 0; i < 2000; ++i) {
            Connection conn = dataSource.getConnection();
            PreparedStatement stmt = conn.prepareStatement("select " + i);
            stmt.execute();
            stmt.close();
            conn.close();
        }
        {
            DruidDataSourceStatValue statValue = dataSource.getStatValueAndReset();
            Assert.assertEquals(2000, statValue.getSqlList().size());
            Assert.assertEquals(0, statValue.getSqlSkipCount());
        }
        {
            DruidDataSourceStatValue statValue = dataSource.getStatValueAndReset();
            Assert.assertEquals(0, statValue.getSqlList().size());
            Assert.assertEquals(0, statValue.getSqlSkipCount());
        }
       
        dataSource.setConnectionProperties("druid.stat.sql.MaxSize=2000");
        for (int i = 0; i < 2000; ++i) {
            Connection conn = dataSource.getConnection();
            PreparedStatement stmt = conn.prepareStatement("select " + i);
            stmt.execute();
            stmt.close();
            conn.close();
        }
        {
            DruidDataSourceStatValue statValue = dataSource.getStatValueAndReset();
            Assert.assertEquals(2000, statValue.getSqlList().size());
            Assert.assertEquals(0, statValue.getSqlSkipCount());
        }
       
        dataSource.setConnectionProperties("druid.stat.sql.MaxSize=100");
        for (int i = 0; i < 2000; ++i) {
            Connection conn = dataSource.getConnection();
            PreparedStatement stmt = conn.prepareStatement("select " + i);
            stmt.execute();
            stmt.close();
            conn.close();
        }
        {
            DruidDataSourceStatValue statValue = dataSource.getStatValueAndReset();
            Assert.assertEquals(100, statValue.getSqlList().size());
            Assert.assertEquals(1900, statValue.getSqlSkipCount());
        }
        {
            DruidDataSourceStatValue statValue = dataSource.getStatValueAndReset();
            Assert.assertEquals(0, statValue.getSqlList().size());
            Assert.assertEquals(0, statValue.getSqlSkipCount());
        }
    }
View Full Code Here

Examples of com.alibaba.druid.pool.DruidDataSourceStatValue

            }

            DruidDataSource dataSource = (DruidDataSource) item;

            if (collectSqlEnable) {
                DruidDataSourceStatValue statValue = dataSource.getStatValueAndReset();
                statValueList.add(statValue);
            }

            if (collectSqlWallEnable) {
                WallProviderStatValue wallStatValue = dataSource.getWallStatValue(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.