fix hard code server ip in opentsdb test program.
[TD-1042]
This commit is contained in:
parent
ad41a5ad72
commit
d0059dfff2
|
@ -206,16 +206,6 @@
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>1.7.25</version>
|
<version>1.7.25</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
|
||||||
<version>1.7.21</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>log4j-over-slf4j</artifactId>
|
|
||||||
<version>1.7.7</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import com.stumbleupon.async.Callback;
|
import com.stumbleupon.async.Callback;
|
||||||
import com.stumbleupon.async.Deferred;
|
import com.stumbleupon.async.Deferred;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import net.opentsdb.core.TSDB;
|
import net.opentsdb.core.TSDB;
|
||||||
import net.opentsdb.uid.NoSuchUniqueName;
|
import net.opentsdb.uid.NoSuchUniqueName;
|
||||||
|
@ -40,13 +39,19 @@ import java.util.concurrent.*;
|
||||||
import java.math.*;
|
import java.math.*;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.apache.log4j.LogManager;
|
||||||
|
import org.apache.log4j.Level;
|
||||||
|
|
||||||
|
|
||||||
public class OpentsdbTest{
|
public class OpentsdbTest{
|
||||||
|
|
||||||
//static { System.setProperty("logback.configurationFile", "/home/ubuntu/fang/opentsdb/opentsdbtest/logback.xml");}
|
//static { System.setProperty("logback.configurationFile", "/home/ubuntu/fang/opentsdb/opentsdbtest/logback.xml");}
|
||||||
static { System.setProperty("logback.configurationFile", "/etc/opentsdb/logback.xml");}
|
static { System.setProperty("logback.configurationFile", "/etc/opentsdb/logback.xml");}
|
||||||
|
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
|
|
||||||
|
Logger logger = LogManager.getLogger(OpentsdbTest.class);
|
||||||
|
logger.setLevel(Level.OFF);
|
||||||
// begin to parse argument
|
// begin to parse argument
|
||||||
String datadir = "/home/ubuntu/testdata";
|
String datadir = "/home/ubuntu/testdata";
|
||||||
String sqlchoice = "q1";
|
String sqlchoice = "q1";
|
||||||
|
@ -156,7 +161,7 @@ public class OpentsdbTest{
|
||||||
}
|
}
|
||||||
switch (sqlchoice) {
|
switch (sqlchoice) {
|
||||||
case "q1":
|
case "q1":
|
||||||
get_url = "http://192.168.1.114:4242/api/query?";
|
get_url = "http://127.0.0.1:4242/api/query?";
|
||||||
/*
|
/*
|
||||||
get_url = get_url + "start=1563249700&m=none:temperature{devgroup=";
|
get_url = get_url + "start=1563249700&m=none:temperature{devgroup=";
|
||||||
get_url = get_url + String.valueOf(ig-10) +"}";
|
get_url = get_url + String.valueOf(ig-10) +"}";
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import com.stumbleupon.async.Callback;
|
import com.stumbleupon.async.Callback;
|
||||||
import com.stumbleupon.async.Deferred;
|
import com.stumbleupon.async.Deferred;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import net.opentsdb.core.TSDB;
|
import net.opentsdb.core.TSDB;
|
||||||
import net.opentsdb.uid.NoSuchUniqueName;
|
import net.opentsdb.uid.NoSuchUniqueName;
|
||||||
|
@ -64,7 +63,7 @@ public class WriteThread extends Thread {
|
||||||
public void run() {
|
public void run() {
|
||||||
StringEntity stringEntity;
|
StringEntity stringEntity;
|
||||||
String port = "4242";
|
String port = "4242";
|
||||||
String put_url = "http://192.168.1.114:"+port+"/api/put?summary";
|
String put_url = "http://127.0.0.1:"+port+"/api/put?summary";
|
||||||
try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
|
try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
|
||||||
/*
|
/*
|
||||||
httpclient.getHttpConnectionManager().getParams()
|
httpclient.getHttpConnectionManager().getParams()
|
||||||
|
|
Loading…
Reference in New Issue