Search in sources :

Example 6 with TFDataSource

use of com.navercorp.pinpoint.thrift.dto.flink.TFDataSource in project pinpoint by naver.

the class TFDataSourceBoMapper method map.

public TFDataSource map(DataSourceBo dataSourceBo) {
    TFDataSource tFDataSource = new TFDataSource();
    tFDataSource.setId(dataSourceBo.getId());
    tFDataSource.setServiceTypeCode(dataSourceBo.getServiceTypeCode());
    tFDataSource.setDatabaseName(dataSourceBo.getDatabaseName());
    tFDataSource.setUrl(dataSourceBo.getJdbcUrl());
    tFDataSource.setActiveConnectionSize(dataSourceBo.getActiveConnectionSize());
    tFDataSource.setMaxConnectionSize(dataSourceBo.getMaxConnectionSize());
    return tFDataSource;
}
Also used : TFDataSource(com.navercorp.pinpoint.thrift.dto.flink.TFDataSource)

Example 7 with TFDataSource

use of com.navercorp.pinpoint.thrift.dto.flink.TFDataSource in project pinpoint by naver.

the class TFDataSourceBoMapperTest method mapTest.

@Test
public void mapTest() {
    DataSourceBo dataSourceBo = new DataSourceBo();
    dataSourceBo.setId(1);
    dataSourceBo.setJdbcUrl("jdbc:mysql");
    dataSourceBo.setDatabaseName("pinpoint");
    dataSourceBo.setServiceTypeCode((short) 1000);
    dataSourceBo.setTimestamp(timestamp);
    dataSourceBo.setActiveConnectionSize(15);
    dataSourceBo.setMaxConnectionSize(30);
    TFDataSourceBoMapper mapper = new TFDataSourceBoMapper();
    TFDataSource tFdataSource = mapper.map(dataSourceBo);
    assertEquals(tFdataSource.getId(), 1);
    assertEquals(tFdataSource.getServiceTypeCode(), 1000);
    assertEquals(tFdataSource.getDatabaseName(), "pinpoint");
    assertEquals(tFdataSource.getUrl(), "jdbc:mysql");
    assertEquals(tFdataSource.getActiveConnectionSize(), 15);
    assertEquals(tFdataSource.getMaxConnectionSize(), 30);
}
Also used : TFDataSource(com.navercorp.pinpoint.thrift.dto.flink.TFDataSource) DataSourceBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo) Test(org.junit.Test)

Example 8 with TFDataSource

use of com.navercorp.pinpoint.thrift.dto.flink.TFDataSource in project pinpoint by naver.

the class JoinDataSourceListBoMapperTest method map2Test.

@Test
public void map2Test() {
    JoinDataSourceListBoMapper mapper = new JoinDataSourceListBoMapper();
    TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    JoinDataSourceListBo joinDataSourceListBo = mapper.map(tFAgentStat);
    assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
    TFDataSourceList tFDataSourceList = new TFDataSourceList();
    tFAgentStat.setDataSourceList(tFDataSourceList);
    joinDataSourceListBo = mapper.map(tFAgentStat);
    assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
    List<TFDataSource> dataSourceList = new ArrayList<>();
    tFDataSourceList.setDataSourceList(dataSourceList);
    joinDataSourceListBo = mapper.map(tFAgentStat);
    assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
}
Also used : TFDataSourceList(com.navercorp.pinpoint.thrift.dto.flink.TFDataSourceList) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFDataSource(com.navercorp.pinpoint.thrift.dto.flink.TFDataSource) JoinDataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo) Test(org.junit.Test)

Aggregations

TFDataSource (com.navercorp.pinpoint.thrift.dto.flink.TFDataSource)8 TFDataSourceList (com.navercorp.pinpoint.thrift.dto.flink.TFDataSourceList)5 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)4 DataSourceBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo)3 JoinDataSourceListBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo)3 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)3 JoinDataSourceBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceBo)2 JoinIntFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo)2 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)1 DataSourceListBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo)1