sensordb2 1 рік тому
батько
коміт
bb477f9988

+ 3 - 3
shell/influxdb/test/insertHistoricalRandomData.sh

@@ -5,8 +5,8 @@ cd $ROOT
 
 source $ROOT/shell/influxdb/common.sh
 
-#dataCountPerPointArray=(1000 2000 3000 5000 10000 20000 30000 50000 100000)
-dataCountPerPointArray=(1000)
+dataCountPerPointArray=(1000 2000 3000 5000 10000 20000 30000 50000 100000 200000 300000 500000)
+#dataCountPerPointArray=(1000)
 #pointCountArray=(2 3 5 10)
 pointCountArray=(1)
 
@@ -26,7 +26,7 @@ do
     echo "----test insert pointCount:${pointCount} dataCountPerPoint:${dataCountPerPoint}"
     java -cp ./lib/influxdb.jar -Xmx8000m demo.allInsert.InsertHistoricalRandomData \
     --host $host --pointNamePrefix ${pointNamePrefix} --pointCount ${pointCount}  \
-    --dataCountPerPoint ${dataCountPerPoint} --beginDate "$beginDate" --period 1000 \
+    --dataCountPerPoint ${dataCountPerPoint} --beginDate "$beginDate" --period 40000 \
     --seed 1 --mean 10 --variance 1 --debug 0 2>&1 | tee -a ./log/influxdb/out.log
   done
 done

+ 30 - 0
shell/influxdb/test/insertHistoricalRandomDataForAPoint.sh

@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+ROOT=$(cd `dirname $0`/../../../; pwd)
+cd $ROOT
+
+source $ROOT/shell/influxdb/common.sh
+
+pointCountArray=(500000)
+pointCountArray=(1)
+
+index=1
+beginDate="2017-06-01 00:00:00"
+echo beginDate:beginDate
+
+for(( i=0;i<${#pointCountArray[@]};i++))
+do
+  pointCount=${pointCountArray[i]}
+  for(( j=0;j<${#dataCountPerPointArray[@]};j++))
+  do
+    #index=`expr $index + 1`
+    echo "[${index}] test"
+    dataCountPerPoint=${dataCountPerPointArray[j]}
+    pointNamePrefix="pointName${index}_"
+    echo "----test insert pointCount:${pointCount} dataCountPerPoint:${dataCountPerPoint}"
+    java -cp ./lib/influxdb.jar -Xmx8000m demo.allInsert.InsertHistoricalRandomData \
+    --host $host --pointNamePrefix ${pointNamePrefix} --pointCount ${pointCount}  \
+    --dataCountPerPoint ${dataCountPerPoint} --beginDate "$beginDate" --period 40000 \
+    --seed 1 --mean 10 --variance 1 --debug 0 2>&1 | tee -a ./log/influxdb/out.log
+  done
+done

+ 27 - 0
shell/iotdb/test/insertHistoricalRandomDataForAPoint.sh

@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+ROOT=$(cd `dirname $0`/../../../; pwd)
+cd $ROOT
+
+source $ROOT/shell/iotdb/common.sh
+
+index=1
+
+#存在插入数据太长将导致连接被断开而退出的问题
+#出现AutoResizingBuffer告警,可能和iotdb配置缓存区大小相关。
+echo "[${index}] test"
+
+pointNamePrefix="pointName${index}_"
+storagePath="root.test1.wf01.wt01"
+beginDate="2017-06-01 00:00:00"
+echo beginDate:beginDate
+
+# 单点插入
+for dataCount in 500000
+do
+echo "----test insert pointCount:${pointCount} dataCountPerPoint:${dataCountPerPoint}"
+nohup java -cp ./lib/iotdb.jar -Xmx8000m demo.insert.InsertHistoricalRandomData \
+--host ${host} --storagePath ${storagePath} --pointNamePrefix ${pointNamePrefix} --pointCount 1 \
+--dataCountPerPoint ${dataCount} --beginDate "$beginDate" --period 40000 \
+--seed 1 --mean 10 --variance 1 --debug 0 2>&1 | tee -a ./log/iotdb/out.log
+done

+ 1 - 1
shell/iotdb/test/insertHistoricalRandomDataPerPoint.sh

@@ -22,6 +22,6 @@ do
 echo "----test insert pointCount:${pointCount} dataCountPerPoint:${dataCountPerPoint}"
 nohup java -cp ./lib/iotdb.jar -Xmx8000m demo.insert.InsertHistoricalRandomData \
 --host ${host} --storagePath ${storagePath} --pointNamePrefix ${pointNamePrefix} --pointCount 1 \
---dataCountPerPoint ${dataCount} --beginDate "$beginDate" --period 1000 \
+--dataCountPerPoint ${dataCount} --beginDate "$beginDate" --period 40000 \
 --seed 1 --mean 10 --variance 1 --debug 0 2>&1 | tee -a ./log/iotdb/out.log
 done

+ 1 - 1
shell/tsdb/test/insertHistoricalRandomData.sh

@@ -11,6 +11,6 @@ do
   echo "----test insert dataCountPerPoint:${dataCount}"
   java -cp ./lib/tsdb.jar -Xmx8000m  demo.allInsert.InsertHistoricalRandomData \
   --host=$host --pointNamePrefix=pointName_ --pointCount=1  --dataCountPerPoint=$dataCount \
-  --beginDate="2017-06-01 00:00:00" --period=1000 \
+  --beginDate="2017-06-01 00:00:00" --period=40000 \
   --seed=1 --mean=10 --variance=0.1 --debug=0 2>&1 | tee -a ./log/tsdb/out.log
 done

+ 16 - 0
shell/tsdb/test/insertHistoricalRandomDataForAPoint.sh

@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+ROOT=$(cd `dirname $0`/../../../; pwd)
+cd $ROOT
+
+source $ROOT/shell/tsdb/common.sh
+
+#for dataCount in 1000 2000 3000 5000 10000 20000 30000 50000 100000 200000 300000 500000 1000000
+for dataCount in 500000
+do
+  echo "----test insert dataCountPerPoint:${dataCount}"
+  java -cp ./lib/tsdb.jar -Xmx8000m  demo.allInsert.InsertHistoricalRandomData \
+  --host=$host --pointNamePrefix=pointName_ --pointCount=1  --dataCountPerPoint=$dataCount \
+  --beginDate="2017-06-01 00:00:00" --period=40000 \
+  --seed=1 --mean=10 --variance=0.1 --debug=0 2>&1 | tee -a ./log/tsdb/out.log
+done

+ 4 - 4
tsdb/src/main/java/dbtest/TestGetHistRaw.java

@@ -10,12 +10,12 @@ import java.util.List;
 
 public class TestGetHistRaw {
     public static void main(String[] args) throws ParseException {
-        String host = Globals.HOST;
-//        String host = "192.168.50.130";
+//        String host = Globals.HOST;
+        String host = "39.104.80.229";
         int port = Globals.port;
-        String pointName = "pt1";
+        String pointName = "pointName20_1";
         String start = "2021-05-15 09:59:58";
-        String end =  "2021-05-15 10:02:00";
+        String end =  "2023-05-15 10:02:00";
         long startTime = Util.dateStringToUTCMilliSeconds(start);
         long endTime = Util.dateStringToUTCMilliSeconds(end);
 

+ 4 - 4
tsdb/src/main/java/dbtest/TestGetRTValueList.java

@@ -9,13 +9,13 @@ import java.util.List;
 
 public class TestGetRTValueList {
     public static void main(String[] args) {
-        String host = Globals.HOST;
-//        String host = "39.104.80.229";
+//        String host = Globals.HOST;
+        String host = "39.104.80.229";
         int port = Globals.port;
         DBApiEntry entry = DBApiEntry.initApiEntry(host, port);
-        String pointNamePrefix = "pointName_test";
+        String pointNamePrefix = "pointName20_";
         List<String> pointNames = new ArrayList<>();
-        int pointCount = 1;
+        int pointCount = 100;
         for (int i = 0; i < pointCount; i++) {
             pointNames.add(pointNamePrefix + i);
         }

+ 4 - 4
tsdb/src/main/java/dbtest/TestSendMultiPoint.java

@@ -10,18 +10,18 @@ import java.util.List;
 
 public class TestSendMultiPoint {
     public static void main(String[] args) {
-        String host = Globals.HOST;
-//        String host = "192.168.50.130";
+//        String host = Globals.HOST;
+        String host = "39.104.80.229";
 
         int port = Globals.port;
         DBApiEntry entry = DBApiEntry.initApiEntry(host, port, false);
 
-        String pointNamePrefix = "pointName_test";
+        String pointNamePrefix = "pointName6_";
         List<DBVal> dbvals = new ArrayList<DBVal>();
 
         long timeStampBegin = Util.currentUTCMilliSeconds();
         int pointCount = 1000;
-        int dataCountPerPoint = 10;
+        int dataCountPerPoint = 1;
         for (int pointIndex = 0; pointIndex < pointCount; pointIndex++) {
             for(int i=0;i<dataCountPerPoint;i++) {
                 DBVal val = new DBVal();

+ 2 - 0
tsdb/src/main/java/demo/allInsert/InsertRealtimeRandomData.java

@@ -129,6 +129,8 @@ public class InsertRealtimeRandomData {
             List<DBVal> dbValList = generateCurrentData(pointNamePrefix, pointCount, seed,
                     mean, variance, debug);
 
+//            logger.info(String.format("dbValList:%s", dbValList));
+
             logger.info(String.format("[%d] start to insert pointNamePrefix:%s size:%d values mean:%f variance:%f seed:%d to db",
                     index, pointNamePrefix, pointCount,
                     mean, variance, seed));