Search in sources :

Example 56 with DatabaseInfo

use of com.navercorp.pinpoint.bootstrap.context.DatabaseInfo in project pinpoint by naver.

the class MySqlUrlParserTest method mysqlParse3.

@Test
public void mysqlParse3() {
    DatabaseInfo dbInfo = jdbcUrlParser.parse("jdbc:mysql://61.74.71.31/log?useUnicode=yes&characterEncoding=UTF-8");
    Assert.assertTrue(dbInfo.isParsingComplete());
    Assert.assertEquals(dbInfo.getType(), MySqlConstants.MYSQL);
    Assert.assertEquals(dbInfo.getHost().get(0), "61.74.71.31");
    Assert.assertEquals(dbInfo.getDatabaseId(), "log");
    Assert.assertEquals(dbInfo.getUrl(), "jdbc:mysql://61.74.71.31/log");
    logger.info(dbInfo.toString());
}
Also used : DatabaseInfo(com.navercorp.pinpoint.bootstrap.context.DatabaseInfo) Test(org.junit.Test)

Example 57 with DatabaseInfo

use of com.navercorp.pinpoint.bootstrap.context.DatabaseInfo in project pinpoint by naver.

the class MySqlUrlParserTest method mysqlParse2.

@Test
public void mysqlParse2() {
    DatabaseInfo dbInfo = jdbcUrlParser.parse("jdbc:mysql://10.98.133.22:3306/test_lucy_db");
    Assert.assertTrue(dbInfo.isParsingComplete());
    Assert.assertEquals(dbInfo.getType(), MySqlConstants.MYSQL);
    Assert.assertEquals(dbInfo.getHost().get(0), "10.98.133.22:3306");
    Assert.assertEquals(dbInfo.getDatabaseId(), "test_lucy_db");
    Assert.assertEquals(dbInfo.getUrl(), "jdbc:mysql://10.98.133.22:3306/test_lucy_db");
    logger.info(dbInfo.toString());
    logger.info(dbInfo.getMultipleHost());
}
Also used : DatabaseInfo(com.navercorp.pinpoint.bootstrap.context.DatabaseInfo) Test(org.junit.Test)

Example 58 with DatabaseInfo

use of com.navercorp.pinpoint.bootstrap.context.DatabaseInfo in project pinpoint by naver.

the class MySqlUrlParserTest method mysqlParse1.

@Test
public void mysqlParse1() {
    DatabaseInfo dbInfo = jdbcUrlParser.parse("jdbc:mysql://ip_address:3306/database_name?useUnicode=yes&characterEncoding=UTF-8");
    Assert.assertTrue(dbInfo.isParsingComplete());
    Assert.assertEquals(dbInfo.getType(), MySqlConstants.MYSQL);
    Assert.assertEquals(dbInfo.getHost().get(0), ("ip_address:3306"));
    Assert.assertEquals(dbInfo.getDatabaseId(), "database_name");
    Assert.assertEquals(dbInfo.getUrl(), "jdbc:mysql://ip_address:3306/database_name");
}
Also used : DatabaseInfo(com.navercorp.pinpoint.bootstrap.context.DatabaseInfo) Test(org.junit.Test)

Example 59 with DatabaseInfo

use of com.navercorp.pinpoint.bootstrap.context.DatabaseInfo in project pinpoint by naver.

the class JtdsJdbcUrlParserTest method testParse5.

@Test
public void testParse5() throws Exception {
    //        jdbc:jtds:sqlserver://server[:port][/database][;property=value[;...]]
    //        jdbc:jtds:sqlserver://server/db;user=userName;password=password
    String url = "jdbc:jtds:sqlserver://10.xx.xx.xx;DatabaseName=CAFECHAT";
    DatabaseInfo info = parser.parse(url);
    Assert.assertTrue(info.isParsingComplete());
    Assert.assertEquals(info.getType(), JtdsConstants.MSSQL);
    Assert.assertEquals(info.getMultipleHost(), "10.xx.xx.xx");
    Assert.assertEquals(info.getDatabaseId(), "CAFECHAT");
    Assert.assertEquals(info.getUrl(), "jdbc:jtds:sqlserver://10.xx.xx.xx");
}
Also used : DatabaseInfo(com.navercorp.pinpoint.bootstrap.context.DatabaseInfo) Test(org.junit.Test)

Example 60 with DatabaseInfo

use of com.navercorp.pinpoint.bootstrap.context.DatabaseInfo in project pinpoint by naver.

the class JtdsJdbcUrlParserTest method testParse7.

@Test
public void testParse7() throws Exception {
    String url = "jdbc:jtds:sqlserver://10.xx.xx.xx:1433/CAFECHAT;abc=1;bcd=2";
    DatabaseInfo info = parser.parse(url);
    Assert.assertTrue(info.isParsingComplete());
    Assert.assertEquals(info.getType(), JtdsConstants.MSSQL);
    Assert.assertEquals(info.getMultipleHost(), "10.xx.xx.xx:1433");
    Assert.assertEquals(info.getDatabaseId(), "CAFECHAT");
    Assert.assertEquals(info.getUrl(), "jdbc:jtds:sqlserver://10.xx.xx.xx:1433/CAFECHAT");
}
Also used : DatabaseInfo(com.navercorp.pinpoint.bootstrap.context.DatabaseInfo) Test(org.junit.Test)

Aggregations

DatabaseInfo (com.navercorp.pinpoint.bootstrap.context.DatabaseInfo)74 Test (org.junit.Test)48 UnKnownDatabaseInfo (com.navercorp.pinpoint.bootstrap.plugin.jdbc.UnKnownDatabaseInfo)25 DatabaseInfoAccessor (com.navercorp.pinpoint.bootstrap.plugin.jdbc.DatabaseInfoAccessor)20 DefaultDatabaseInfo (com.navercorp.pinpoint.bootstrap.plugin.jdbc.DefaultDatabaseInfo)8 ParsingResult (com.navercorp.pinpoint.bootstrap.context.ParsingResult)4 SpanEventRecorder (com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)4 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)4 ParsingResultAccessor (com.navercorp.pinpoint.bootstrap.plugin.jdbc.ParsingResultAccessor)4 RegularStatement (com.datastax.driver.core.RegularStatement)2 BindValueAccessor (com.navercorp.pinpoint.bootstrap.plugin.jdbc.BindValueAccessor)2 BoundStatement (com.datastax.driver.core.BoundStatement)1 Cluster (com.datastax.driver.core.Cluster)1 Host (com.datastax.driver.core.Host)1 InstrumentClass (com.navercorp.pinpoint.bootstrap.instrument.InstrumentClass)1 InstrumentException (com.navercorp.pinpoint.bootstrap.instrument.InstrumentException)1 Instrumentor (com.navercorp.pinpoint.bootstrap.instrument.Instrumentor)1 TransformCallback (com.navercorp.pinpoint.bootstrap.instrument.transformer.TransformCallback)1 JdbcUrlParserV2 (com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2)1 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)1