|
|
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;
|
|
|
import org.junit.Before;
|
|
|
import org.junit.Test;
|
...
|
...
|
@@ -11,12 +8,9 @@ import org.junit.runner.RunWith; |
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.context.annotation.PropertySource;
|
|
|
import org.springframework.test.context.ContextConfiguration;
|
|
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
|
|
|
|
import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -32,7 +26,7 @@ public class InfluxDBSimpleTest { |
|
|
private InluxDBSingle inluxDBSingle;
|
|
|
|
|
|
@Autowired
|
|
|
private CommonQuery commonQuery;
|
|
|
private InfluxDataReporter commonQuery;
|
|
|
|
|
|
@Before
|
|
|
public void init() {
|
...
|
...
|
@@ -62,7 +56,7 @@ public class InfluxDBSimpleTest { |
|
|
}*/
|
|
|
String sql="select \"name\",number from test";
|
|
|
String db="gml_test";
|
|
|
QueryResult queryResult = commonQuery.query("test", sql, db);
|
|
|
QueryResult queryResult = commonQuery.queryResult("test", sql, db);
|
|
|
logger.info("{}",queryResult);
|
|
|
List<QueryResult.Series> seriesList = QueryResultUtil.getSeries(queryResult);
|
|
|
if (seriesList == null) {
|
...
|
...
|
|