Authored by qinchao

test配置文件

package com.monitor.influxdb;
import com.monitor.influxdb.mapper.impl.CommonQuery;
import com.monitor.influxdb.util.QueryResultUtil;
import org.influxdb.dto.Pong;
import org.influxdb.dto.Query;
import org.influxdb.dto.QueryResult;
... ... @@ -29,6 +31,8 @@ public class InfluxDBSimpleTest {
@Autowired
private InluxDBSingle inluxDBSingle;
@Autowired
private CommonQuery commonQuery;
@Before
public void init() {
... ... @@ -37,7 +41,7 @@ public class InfluxDBSimpleTest {
@Test
public void test() {
InfluxDBModel influxDBModel = inluxDBSingle.getInfluxDBByName("test");
/* InfluxDBModel influxDBModel = inluxDBSingle.getInfluxDBByName("test");
Pong pong = influxDBModel.getInfluxDB().ping();
logger.info("pong: {}", pong.getResponseTime());
... ... @@ -46,15 +50,25 @@ public class InfluxDBSimpleTest {
for (String strDatabase : databaseList) {
logger.info("name:{}", strDatabase);
}
*/
Query query=new Query("select * from rabbitmq_sent","yoho_order");
/* Query query=new Query("select * from rabbitmq_sent","yoho_order");
QueryResult result=influxDBModel.getInfluxDB().query(query);
Iterator<QueryResult.Result> itResult=result.getResults().iterator();
while (itResult.hasNext()){
QueryResult.Result result1=itResult.next();
logger.info("{}",result.toString());
}*/
String sql="select \"name\",number from test";
String db="gml_test";
QueryResult queryResult = commonQuery.query("test", sql, db);
logger.info("{}",queryResult);
List<QueryResult.Series> seriesList = QueryResultUtil.getSeries(queryResult);
if (seriesList == null) {
logger.info(" null series list");
}else{
logger.info(" ok series list");
}
}
... ...
# ******************** influxdb common configs ********************
influxdb.num=1
influxdb.name=test
influxdb.ip=http://172.16.6.82:32768
influxdb.user=frw
influxdb.pwd=frw
influxdb.ip=http://192.168.103.93:8086
influxdb.user=root
influxdb.pwd=123456
influxdb.connect.timeout=15
influxdb.read.timeout=40
influxdb.write.timeout=20
\ No newline at end of file
... ...